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:
Wilmer Paulino
2018-08-28 19:17:14 -07:00
parent 2f1b024679
commit e1a376d9f8
3 changed files with 33 additions and 25 deletions

View File

@ -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
}