wallet: avoid double-writing block stamps in onFilteredBlockConnected

This commit is contained in:
Olaoluwa Osuntokun 2017-06-13 11:08:25 +02:00
parent 598394c51a
commit 3567ae87f4

View file

@ -55,12 +55,9 @@ func (w *Wallet) handleChainNotifications() {
case chain.FilteredBlockConnected:
// Atomically update for the whole block.
err = walletdb.Update(w.db, func(tx walletdb.ReadWriteTx) error {
err := w.connectBlock(tx, *n.Block)
if err != nil {
return err
}
var err error
for _, rec := range n.RelevantTxs {
err := w.addRelevantTx(tx, rec, n.Block)
err = w.addRelevantTx(tx, rec, n.Block)
if err != nil {
return err
}