Skip to content

Commit

Permalink
Merge pull request #724 from guggero/namespace-fix
Browse files Browse the repository at this point in the history
wallet: fix incorrect namespace name
  • Loading branch information
Roasbeef authored Nov 18, 2020
2 parents 9bd6d26 + be57c71 commit 5ee84d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
// the transaction.
var ourAddrs []btcutil.Address
err = walletdb.Update(w.db, func(dbTx walletdb.ReadWriteTx) error {
txmgrNs := dbTx.ReadWriteBucket(wtxmgrNamespaceKey)
addrmgrNs := dbTx.ReadWriteBucket(waddrmgrNamespaceKey)
for _, txOut := range tx.TxOut {
_, addrs, _, err := txscript.ExtractPkScriptAddrs(
txOut.PkScript, w.chainParams,
Expand All @@ -3481,7 +3481,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
for _, addr := range addrs {
// Skip any addresses which are not relevant to
// us.
_, err := w.Manager.Address(txmgrNs, addr)
_, err := w.Manager.Address(addrmgrNs, addr)
if waddrmgr.IsError(err, waddrmgr.ErrAddressNotFound) {
continue
}
Expand All @@ -3503,6 +3503,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,

// If there is a label we should write, get the namespace key
// and record it in the tx store.
txmgrNs := dbTx.ReadWriteBucket(wtxmgrNamespaceKey)
return w.TxStore.PutTxLabel(txmgrNs, tx.TxHash(), label)
})
if err != nil {
Expand Down

0 comments on commit 5ee84d8

Please sign in to comment.