Fetch more Tokens
This commit is contained in:
parent
7682351753
commit
b389a3421a
|
@ -71,7 +71,7 @@ func (ta *TokenBoardClient) Init(connection tapir.Connection) {
|
|||
log.Debugf("Successfully Initialized Connection")
|
||||
go ta.Listen()
|
||||
// Optimistically acquire many tokens for this server...
|
||||
go ta.MakePayment()
|
||||
ta.MakePayment()
|
||||
ta.Replay()
|
||||
} else {
|
||||
connection.Close()
|
||||
|
@ -200,6 +200,9 @@ func (ta *TokenBoardClient) MakePayment() error {
|
|||
log.Debugf("Updating Tokens")
|
||||
ta.tokenLock.Lock()
|
||||
ta.tokens = append(ta.tokens, powtapp.Tokens...)
|
||||
if len(ta.tokens) < 10 {
|
||||
go ta.MakePayment()
|
||||
}
|
||||
ta.tokenLock.Unlock()
|
||||
log.Debugf("Transcript: %v", powtapp.Transcript().OutputTranscriptToAudit())
|
||||
conn.Close()
|
||||
|
|
Loading…
Reference in New Issue