Merge pull request #514 from vapopov/zerobalance

wallet: fix lost balance of unmined transaction for neutrino
This commit is contained in:
Olaoluwa Osuntokun 2018-07-23 17:58:56 -07:00 committed by GitHub
commit 8b2629a935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3225,6 +3225,15 @@ func (w *Wallet) PublishTransaction(tx *wire.MsgTx) error {
_, err = server.SendRawTransaction(tx, false)
switch {
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
// The following are errors returned from btcd's mempool.