From d20d4b18c2c047d524e728392623592d35236717 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 10 Sep 2021 11:02:25 -0700 Subject: [PATCH] deep logging --- protocol/connections/tokenboardclientapp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/connections/tokenboardclientapp.go b/protocol/connections/tokenboardclientapp.go index c365365..1ca69fe 100644 --- a/protocol/connections/tokenboardclientapp.go +++ b/protocol/connections/tokenboardclientapp.go @@ -12,6 +12,7 @@ import ( "git.openprivacy.ca/openprivacy/connectivity" "git.openprivacy.ca/openprivacy/log" "github.com/gtank/ristretto255" + "reflect" "sync" "time" ) @@ -185,6 +186,7 @@ func (ta *TokenBoardClient) MakePayment() error { connected, err := client.Connect(ta.tokenServiceOnion, powTokenApp) if connected == true && err == nil { + log.Debugf("Waiting for successful Token Acquisition...") conn, err := client.WaitForCapabilityOrClose(ta.tokenServiceOnion, applications.HasTokensCapability) if err == nil { powtapp, ok := conn.App().(*applications.TokenApplication) @@ -199,11 +201,13 @@ func (ta *TokenBoardClient) MakePayment() error { conn.Close() return nil } - log.Errorf("invalid case of powapp. this should not happen") + log.Errorf("invalid cast of powapp. this should not happen %v %v", powtapp, reflect.TypeOf(conn.App())) return errors.New("invalid cast of powapp. this should never happen") } log.Debugf("could not connect to payment server %v..trying again") return ta.MakePayment() + } else if connected && err != nil { + log.Debugf("inexplicable error: %v", err) } log.Debugf("failed to make a connection. trying again...") // it doesn't actually take that long to make a payment, so waiting a small amount of time should suffice