deep logging
This commit is contained in:
parent
e967f151ee
commit
d20d4b18c2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue