wallet: fix lost balance of unmined transaction for neutrino
This commit is contained in:
parent
74a7124666
commit
40ba75dd9d
1 changed files with 9 additions and 0 deletions
|
@ -3224,6 +3224,15 @@ func (w *Wallet) PublishTransaction(tx *wire.MsgTx) error {
|
||||||
_, err = server.SendRawTransaction(tx, false)
|
_, err = server.SendRawTransaction(tx, false)
|
||||||
switch {
|
switch {
|
||||||
case err == nil:
|
case err == nil:
|
||||||
|
switch w.chainClient.(type) {
|
||||||
|
// For neutrino we need to trigger adding relevant tx manually
|
||||||
|
// because for spv client - tx data isn't received from sync peer.
|
||||||
|
case *chain.NeutrinoClient:
|
||||||
|
return walletdb.Update(w.db, func(tx walletdb.ReadWriteTx) error {
|
||||||
|
return w.addRelevantTx(tx, txRec, nil)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
// The following are errors returned from btcd's mempool.
|
// The following are errors returned from btcd's mempool.
|
||||||
|
|
Loading…
Reference in a new issue