Fixed a bug where unconfirmed txn notifications were missing a label

This commit is contained in:
ennmichael 2021-10-21 19:55:30 +02:00 committed by Roy Lee
parent 759741dccc
commit e74c3939aa

View file

@ -3468,19 +3468,16 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
}
}
if err := w.addRelevantTx(dbTx, txRec, nil); err != nil {
return err
}
// If the tx label is empty, we can return early.
if len(label) == 0 {
return nil
}
// If there is a label we should write, get the namespace key
// and record it in the tx store.
if len(label) != 0 {
txmgrNs := dbTx.ReadWriteBucket(wtxmgrNamespaceKey)
return w.TxStore.PutTxLabel(txmgrNs, tx.TxHash(), label)
if err = w.TxStore.PutTxLabel(txmgrNs, tx.TxHash(), label); err != nil {
return err
}
}
return w.addRelevantTx(dbTx, txRec, nil)
})
if err != nil {
return nil, err