mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge de3c46c938 into merged_master (Bitcoin PR bitcoin/bitcoin#25272)
This commit is contained in:
commit
cefc4804f5
3 changed files with 117 additions and 1 deletions
|
|
@ -1140,7 +1140,13 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, const SyncTxS
|
|||
// Block disconnection override an abandoned tx as unconfirmed
|
||||
// which means user may have to call abandontransaction again
|
||||
TxState tx_state = std::visit([](auto&& s) -> TxState { return s; }, state);
|
||||
return AddToWallet(MakeTransactionRef(tx), tx_state, /*update_wtx=*/nullptr, /*fFlushOnClose=*/false, rescanning_old_block);
|
||||
CWalletTx* wtx = AddToWallet(MakeTransactionRef(tx), tx_state, /*update_wtx=*/nullptr, /*fFlushOnClose=*/false, rescanning_old_block);
|
||||
if (!wtx) {
|
||||
// Can only be nullptr if there was a db write error (missing db, read-only db or a db engine internal writing error).
|
||||
// As we only store arriving transaction in this process, and we don't want an inconsistent state, let's throw an error.
|
||||
throw std::runtime_error("DB error adding transaction to wallet, write failed");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue