autopilot: use updateBalance rather than tracking balance explicitly
In this commit, we modify the balanceUpdate autopilot signal to update the balance according to what's returned to the WalletBalance callback rather than explicitly tracking the balance. This gives the agent a better sense of what the wallet's balance actually is.
This commit is contained in:
3 files changed
+33
-25
No files matched your search
@@ -224,8 +224,8 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error)
|
||||
|
||||
for {
|
||||
select {
|
||||
case txnUpdate := <-txnSubscription.ConfirmedTransactions():
|
||||
pilot.OnBalanceChange(txnUpdate.Value)
|
||||
case <-txnSubscription.ConfirmedTransactions():
|
||||
pilot.OnBalanceChange()
|
||||
case <-svr.quit:
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user