…eady in mempool
Mempool loads first, wallet second. Second attempt fails, marking that transaction !fInMempool. Those funds will disappear until confirmation is reached.
…eady in mempool
Mempool loads first, wallet second. Second attempt fails, marking that transaction !fInMempool. Those funds will disappear until confirmation is reached.
mempool_persist.py
instead, as wallet is already a “test everything that has something to do with sending bitcoin”
@TheBlueMatt right, feels quite brittle, but wanted to throw up a working solution/test.
Knowing whether a boolean is already set sounds like boost::optional(?) @MarcoFalke noted, will move
Knowing whether a boolean is already set sounds like boost::optional(?)
Or std::optional as of C++17 :-)
0-----BEGIN PGP SIGNED MESSAGE-----
1Hash: SHA512
2
3Tested ACK f72f5e2576650c3fc314e16f33dbcf24e85520ec
4-----BEGIN PGP SIGNATURE-----
5
6iQIcBAEBCgAGBQJaKCkKAAoJENLqSFDnUoslHSkP/2QJqJa6aKFbp4ripP81rep5
7jB074r5uPkh6Oa4MgbCI4dte9BQNkfIZ8wTl9sfNax50j8TMeglSHubn6P/F50A/
8zo0HJG767dvQMxGd+KSxYAS9nk9Oh4iY6SZs44lVYvOxUjnzlRTl9ElbzmDW+BOY
9deqwbH3xv25Ii9+xrvjzHBt/3jiWmdMDJ6NjqJofCmsrLARY3NHL/IQhAG8sqSPR
10QSu81crg25IshaO55JPOu2EyXMhnv5M3AF3O4kqaxSFZ3CyioXJhMgggs+n/ZZbI
110hGOxNFHjAznTOFD3/a8/6ritVtpyhUbtPe00k0LcAssTWiqjLtfU2mEpF/HudYV
12HvNdDogxXoXjsQTKjxtKYetm1oe/NrGtRpI207cMw5TL+q2XINRApgCJ48Sb5qVr
13cOsVokhy1VdPS8OGQHGusiEfmUC60nX8thixbKbhf/z76NEFiPDNT4Nyq5qjIs82
14ps2EbX9L66IPCKwP2w25L2EMK3cZaTkox2XNfQS0zKM/reDSzUSlypENA7V/R7dz
15CaE7rCOwllHUu/mr9ANKcug3jeikDkrI7kFDg11Dxr9Pdt97YUrJtblYmL97Nlyp
16NDZihNY1xCfFLUqQXwpxDma+VEcafeTw1R7mZDHWQwg04Vtd+U/EX+6Rw2Cs4TAU
17awhmaenWj7pKls9ql2gW
18=MeI2
19-----END PGP SIGNATURE-----
@TheBlueMatt although unrelated to this bug, isn’t it a good idea in general to check !mempool.exists(...)
before trying to add a transaction to the mempool? Or perhaps AcceptToMemoryPool
should check if already contains the transaction before proceeding?
Or does that not work due to the concurrency issue you described?
CWalletTx::AcceptToMemoryPool
, it should check for mempool.exists()
instead of the |=
logic. Imo this better documents by code what is being done.
4113@@ -4114,6 +4114,11 @@ int CMerkleTx::GetBlocksToMaturity() const
4114
4115 bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
4116 {
4117+ // Quick check to avoid re-setting fInMempool to false