From 2bd41b9dd151a029a930518d3fc76ce5b40f6baf Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 9 Jun 2020 12:45:33 -0700 Subject: [PATCH] wallet: handle new error string for missing/spent input in bitcoind 0.20 The error string was updated in: https://github.com/bitcoin/bitcoin/pull/15921/commits/3004d5a12d09d94bfc4dee2a8e8f2291996a4aaf --- wallet/wallet.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wallet/wallet.go b/wallet/wallet.go index 6cd55df..4952498 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -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 // is spending either output that is missing or already spent. + // // 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{ backendError: err, }