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")
|
log.Debugf("Successfully Initialized Connection")
|
||||||
go ta.Listen()
|
go ta.Listen()
|
||||||
// Optimistically acquire many tokens for this server...
|
// Optimistically acquire many tokens for this server...
|
||||||
go ta.MakePayment()
|
ta.MakePayment()
|
||||||
ta.Replay()
|
ta.Replay()
|
||||||
} else {
|
} else {
|
||||||
connection.Close()
|
connection.Close()
|
||||||
|
@ -200,6 +200,9 @@ func (ta *TokenBoardClient) MakePayment() error {
|
||||||
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) < 10 {
|
||||||
|
go ta.MakePayment()
|
||||||
|
}
|
||||||
ta.tokenLock.Unlock()
|
ta.tokenLock.Unlock()
|
||||||
log.Debugf("Transcript: %v", powtapp.Transcript().OutputTranscriptToAudit())
|
log.Debugf("Transcript: %v", powtapp.Transcript().OutputTranscriptToAudit())
|
||||||
conn.Close()
|
conn.Close()
|
||||||
|
|
Loading…
Reference in New Issue