Maintain Tokens
This commit is contained in:
parent
9254c9bc07
commit
0f09a5ddcf
|
@ -189,12 +189,15 @@ func (ta *TokenBoardClient) MakePayment() error {
|
|||
if ok {
|
||||
// Update tokens...we need a lock here to prevent SpendToken from modifying the tokens
|
||||
// during this process..
|
||||
log.Debugf("Transcript: %v", powtapp.Transcript().OutputTranscriptToAudit())
|
||||
conn.Close()
|
||||
log.Debugf("Updating Tokens")
|
||||
ta.tokenLock.Lock()
|
||||
ta.tokens = append(ta.tokens, powtapp.Tokens...)
|
||||
if len(ta.tokens) < 5 {
|
||||
go ta.MakePayment()
|
||||
}
|
||||
ta.tokenLock.Unlock()
|
||||
log.Debugf("Transcript: %v", powtapp.Transcript().OutputTranscriptToAudit())
|
||||
conn.Close()
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue