Merge pull request #705 from wpaulino/bitcoind-20-compat

wallet: handle new error string for missing/spent input in bitcoind 0.20
This commit is contained in:
Olaoluwa Osuntokun 2020-06-11 18:25:34 -07:00 committed by GitHub
commit 48addcd559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3615,8 +3615,12 @@ func (w *Wallet) publishTransaction(tx *wire.MsgTx) (*chainhash.Hash, error) {
// Returned by bitcoind on the RPC when broadcasting a transaction that // Returned by bitcoind on the RPC when broadcasting a transaction that
// is spending either output that is missing or already spent. // is spending either output that is missing or already spent.
//
// https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L49 // https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L49
case match(err, "missing inputs"): // https://github.com/bitcoin/bitcoin/blob/0.20/src/validation.cpp#L642
case match(err, "missing inputs") ||
match(err, "bad-txns-inputs-missingorspent"):
returnErr = &ErrDoubleSpend{ returnErr = &ErrDoubleSpend{
backendError: err, backendError: err,
} }