Skip to content

Commit

Permalink
[mempool] Mark mempool import fails that were found in mempool as 'al…
Browse files Browse the repository at this point in the history
…ready there'

Summary:
I was investigating the reasons for failed imports in mempool and noticed that `LoadMempool()` and `pwallet->postInitProcess()` (for all wallets) are executed concurrently. The wallet will end up importing transactions that `LoadMempool()` later tries to import; the latter will fail due to the tx already being in the mempool.

Backport of Bitcoin Core PR11062
bitcoin/bitcoin#11062

Test Plan:
```
make check-all
```

Reviewers: Fabien, #bitcoin_abc, deadalnix

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4266
  • Loading branch information
kallewoof authored and jonspock committed Oct 1, 2020
1 parent a8b09f0 commit ea8f9b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/validation.cpp
Expand Up @@ -5873,6 +5873,10 @@ bool LoadMempool(const Config &config, CTxMemPool &pool) {
} else {
++expired;
}

if (ShutdownRequested()) {
return false;
}
}
std::map<uint256, Amount> mapDeltas;
file >> mapDeltas;
Expand Down

0 comments on commit ea8f9b2

Please sign in to comment.