Skip to content

Commit

Permalink
[Wallet] Adapting TransactionAddedToMempool and BlockDisconnected to …
Browse files Browse the repository at this point in the history
…the new wtx confirmation status

Status::UNCONFIRMED always must have the index in 0, a negative index means that the transaction was abandoned.
  • Loading branch information
furszy committed Mar 10, 2021
1 parent ff04fa6 commit da78039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ void CWallet::SyncTransaction(const CTransactionRef& ptx, CWalletTx::Status stat
void CWallet::TransactionAddedToMempool(const CTransactionRef& ptx)
{
LOCK2(cs_main, cs_wallet);
SyncTransaction(ptx, CWalletTx::Status::UNCONFIRMED, nullptr, -1);
SyncTransaction(ptx, CWalletTx::Status::UNCONFIRMED, nullptr, 0);

auto it = mapWallet.find(ptx->GetHash());
if (it != mapWallet.end()) {
Expand Down Expand Up @@ -1313,7 +1313,7 @@ void CWallet::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, int
// User may have to call abandontransaction again. It may be addressed in the
// future with a stickier abandoned state or even removing abandontransaction call.
for (const CTransactionRef& ptx : pblock->vtx) {
SyncTransaction(ptx, CWalletTx::Status::UNCONFIRMED, nullptr, -1);
SyncTransaction(ptx, CWalletTx::Status::UNCONFIRMED, nullptr, 0);
}

if (Params().GetConsensus().NetworkUpgradeActive(nBlockHeight, Consensus::UPGRADE_V5_0)) {
Expand Down

0 comments on commit da78039

Please sign in to comment.