Merge pull request #724 from guggero/namespace-fix

wallet: fix incorrect namespace name
This commit is contained in:
Olaoluwa Osuntokun 2020-11-18 11:51:56 -08:00 committed by GitHub
commit 5ee84d89ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3468,7 +3468,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
// the transaction. // the transaction.
var ourAddrs []btcutil.Address var ourAddrs []btcutil.Address
err = walletdb.Update(w.db, func(dbTx walletdb.ReadWriteTx) error { err = walletdb.Update(w.db, func(dbTx walletdb.ReadWriteTx) error {
txmgrNs := dbTx.ReadWriteBucket(wtxmgrNamespaceKey) addrmgrNs := dbTx.ReadWriteBucket(waddrmgrNamespaceKey)
for _, txOut := range tx.TxOut { for _, txOut := range tx.TxOut {
_, addrs, _, err := txscript.ExtractPkScriptAddrs( _, addrs, _, err := txscript.ExtractPkScriptAddrs(
txOut.PkScript, w.chainParams, txOut.PkScript, w.chainParams,
@ -3481,7 +3481,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
for _, addr := range addrs { for _, addr := range addrs {
// Skip any addresses which are not relevant to // Skip any addresses which are not relevant to
// us. // us.
_, err := w.Manager.Address(txmgrNs, addr) _, err := w.Manager.Address(addrmgrNs, addr)
if waddrmgr.IsError(err, waddrmgr.ErrAddressNotFound) { if waddrmgr.IsError(err, waddrmgr.ErrAddressNotFound) {
continue continue
} }
@ -3503,6 +3503,7 @@ func (w *Wallet) reliablyPublishTransaction(tx *wire.MsgTx,
// If there is a label we should write, get the namespace key // If there is a label we should write, get the namespace key
// and record it in the tx store. // and record it in the tx store.
txmgrNs := dbTx.ReadWriteBucket(wtxmgrNamespaceKey)
return w.TxStore.PutTxLabel(txmgrNs, tx.TxHash(), label) return w.TxStore.PutTxLabel(txmgrNs, tx.TxHash(), label)
}) })
if err != nil { if err != nil {