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