ryanofsky
commented at 5:08 am on February 17, 2021:
contributor
Current CWalletTx state representation makes it possible to set inconsistent states that won’t be handled correctly by wallet sync code or serialized & deserialized back into the same form.
For example, it is possible to call setConflicted without setting a conflicting block hash, or setConfirmed with no transaction index. And it’s possible update individual m_confirm and fInMempool data fields without setting an overall consistent state that can be serialized and handled correctly.
Fix this without changing behavior by using std::variant, instead of an enum and collection of fields, to represent sync state, so state tracking code is safer and more legible.
fanquake added the label
Refactoring
on Feb 17, 2021
fanquake added the label
Wallet
on Feb 17, 2021
ryanofsky referenced this in commit
2a855bf092
on Feb 17, 2021
ryanofsky force-pushed
on Feb 17, 2021
DrahtBot
commented at 10:25 am on February 17, 2021:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#23497 (Add src/node/ and src/wallet/ code to node:: and wallet:: namespaces by ryanofsky)
#23411 (refactor: Avoid integer overflow in ApplyStats when activating snapshot by MarcoFalke)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
DrahtBot added the label
Needs rebase
on Feb 19, 2021
in
src/wallet/transaction.h:136
in
7bc16a0b42outdated
nit, CWalletTx(const CWallet*, CTransactionRef arg) to make it clear wallet is unused.
Good catch! Removed unused argument in this commit instead of later commit
promag
commented at 12:56 pm on February 21, 2021:
member
Approach ACK (also base PR).
This makes it a lot easier to reason about transaction state. Another great achievement is dropping wallet dependency from transaction. 👏
ryanofsky referenced this in commit
11dd250fb1
on Mar 4, 2021
ryanofsky referenced this in commit
01f4bb2693
on Mar 4, 2021
ryanofsky force-pushed
on Mar 4, 2021
ryanofsky
commented at 0:41 am on March 4, 2021:
contributor
Rebased 792d72e2a17fa34e173a82171bdaee3ba88f3e74 -> a4bc501a00293a12f0f6d44d85ffb324823b472d (pr/txstate.2 -> pr/txstate.3, compare) on top of #21207 pr/txmove.2
Rebased a4bc501a00293a12f0f6d44d85ffb324823b472d -> 56aeb9ff7d5942fdb010db3773e26233e0d1612d (pr/txstate.3 -> pr/txstate.4, compare) on top of #21207 pr/txmove.3
Rebased 56aeb9ff7d5942fdb010db3773e26233e0d1612d -> 4c5f91eaf834e3eacc480c8d277e64aebc5ebd4e (pr/txstate.4 -> pr/txstate.5, compare) due to conflicts with #21331 and #18842
Rebased 4c5f91eaf834e3eacc480c8d277e64aebc5ebd4e -> ed04456421d8092457fbefd70b77c13a53a3d20f (pr/txstate.5 -> pr/txstate.6, compare) on top of #21207 pr/txmove.4 due to conflict with #21141
Rebased ed04456421d8092457fbefd70b77c13a53a3d20f -> 045e712a489ed8df4cc15f29a059c8f661759e72 (pr/txstate.6 -> pr/txstate.7, compare) on top of #21207 pr/txmove.5
Rebased 045e712a489ed8df4cc15f29a059c8f661759e72 -> 4e11f88320b644b67db55fe737815451ca7d0681 (pr/txstate.7 -> pr/txstate.8, compare) due to conflict with #21666
DrahtBot removed the label
Needs rebase
on Mar 4, 2021
DrahtBot added the label
Needs rebase
on Mar 8, 2021
ryanofsky referenced this in commit
74d45298e5
on Mar 8, 2021
ryanofsky referenced this in commit
065e94fd97
on Mar 8, 2021
ryanofsky force-pushed
on Mar 8, 2021
DrahtBot removed the label
Needs rebase
on Mar 9, 2021
DrahtBot added the label
Needs rebase
on Mar 10, 2021
ryanofsky referenced this in commit
68e865e6b7
on Mar 10, 2021
ryanofsky force-pushed
on Mar 10, 2021
ryanofsky referenced this in commit
8da243cc98
on Mar 10, 2021
DrahtBot removed the label
Needs rebase
on Mar 10, 2021
DrahtBot added the label
Needs rebase
on Mar 12, 2021
ryanofsky referenced this in commit
e7eebeb6d1
on Mar 21, 2021
ryanofsky referenced this in commit
7c188f3508
on Mar 21, 2021
ryanofsky force-pushed
on Mar 21, 2021
DrahtBot removed the label
Needs rebase
on Mar 22, 2021
DrahtBot added the label
Needs rebase
on Apr 13, 2021
ryanofsky referenced this in commit
a71a7db9a9
on Apr 13, 2021
ryanofsky referenced this in commit
9b6bdfb08a
on Apr 13, 2021
ryanofsky force-pushed
on Apr 13, 2021
DrahtBot removed the label
Needs rebase
on Apr 13, 2021
DrahtBot added the label
Needs rebase
on Apr 14, 2021
ryanofsky force-pushed
on Apr 14, 2021
DrahtBot removed the label
Needs rebase
on Apr 14, 2021
in
src/wallet/interfaces.cpp:85
in
4e11f88320outdated
The code does repeat a few places but I think I’d still rather not have this. I think all these positive and negative height and magic height and depth values are bad and we should just pass the actual state information around. It would be good to clean up this code later (would avoid it for now to avoid expanding scope of pr), but I think the cleanup should more try to get rid of the magic height values than to try to construct them quietly.
in
src/wallet/wallet.cpp:809
in
4e11f88320outdated
787@@ -788,7 +788,9 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
788 // notification so the wallet is in an internally consistent state and
789 // immediately knows the old transaction should not be considered trusted
790 // and is eligible to be abandoned
791- wtx.fInMempool = chain().isInMempool(originalHash);
792+ if (wtx.state<TxStateInMempool>() && !chain().isInMempool(originalHash)) {
The main reason is to be equivalent as possible to previous code. Previous code didn’t change the transactions abandon/unconfirmed/conflicted state and this code isn’t trying to do that either. Also, I think it makes the code more closely match the comment above. Maybe we can make the comment more clear though. It seems like it could be a little more specific but I’m not sure what extra explanation or details might be good to add.
in
src/wallet/wallet.cpp:1000
in
4e11f88320outdated
973- if (chain().findBlock(wtx.m_confirm.hashBlock, FoundBlock().inActiveChain(active).height(height)) && active) {
974- // Update cached block height variable since it not stored in the
975- // serialized transaction.
976- wtx.m_confirm.block_height = height;
977- } else if (wtx.isConflicted() || wtx.isConfirmed()) {
978+ auto lookup_block = [&](const uint256& hash, int& height, TxState& state) {
nit, lookup_block seems misleading, maybe update_tx_state or mark_inactive.
I guess it’s not too important because the definition is a few lines away from the usage, but those names seem more misleading to me. The lambda is looking up a block hash and returning the block height in an output parameter. In the error case it also returns a txstate. I think it’s reasonable to name a function after the main thing it does, even if the name doesn’t encompass everything it does in all cases, especially in a local context like this where it’s not going to be called by faraway code.
This code definitely sucks and there will be a lot of opportunities to improve it later (see
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking). This commit is just trying to make a simple-as-possible global change to the state representation in order to be able to make local improvements in places like this more easy in the future.
in
src/util/overloaded.h:12
in
4e11f88320outdated
7+
8+#include <optional>
9+#include <utility>
10+
11+//! Overloaded helper for std::visit, useful to write code that switches on a
12+//! variant type and triggers a compile error if there are any unhandled cases.
Just for reference, our existing use of std::visit will also throw compile errors even without this helper. I guess the goal of the helper is to having to write less code in the switch itself?
Just for reference, our existing use of std::visit will also throw compile errors even without this helper. I guess the goal of the helper is to having to write less code in the switch itself?
I think all existing uses of uses of std::visit use custom visitor classes which don’t have access to local variables or anything. Or at least they did at the time this was written which was shortly after we enabled c++17. If it makes sense to define visitor classes for a particular variant type, this isn’t really meant to be an alternative to that. This is just meant to be an alternative to using if/else if statements or a switch statement. I can update the comment to make it more clear, unless you’re suggesting there might be a better way to use std::visit without this helper. In that case we could get rid of this.
in
src/wallet/transaction.h:50
in
4e11f88320outdated
45+//! or be abandoned, never broadcast, or rejected from the mempool for another
46+//! reason.
47+struct TxStateInactive {
48+ bool abandoned;
49+
50+ explicit TxStateInactive(bool abandoned=false) : abandoned(abandoned) {}
Can do if another change is required. This line isn’t changing, and I’m trying to minimize the diff. The variable scope is pretty small already too.
promag
commented at 2:56 pm on April 26, 2021:
member
Code review and tested ACK4e11f88320b644b67db55fe737815451ca7d0681 (including base PR). Some nits for your consideration.
I think this approach is superior simply because it prevents state inconsistency. Maybe a followup could be to make state members const.
Another nice touch in this PR is SyncTxState type which makes it clear which states are handled/accepted in SyncTransaction.
DrahtBot added the label
Needs rebase
on Apr 29, 2021
ryanofsky referenced this in commit
c9e8a508e5
on Apr 30, 2021
ryanofsky referenced this in commit
4984c4548c
on Apr 30, 2021
ryanofsky force-pushed
on Apr 30, 2021
ryanofsky
commented at 6:15 pm on April 30, 2021:
contributor
Thanks for the review! I really appreciate it on a noisy PR like this where there are so many small changes.
Rebased 4e11f88320b644b67db55fe737815451ca7d0681 -> a5a537fd95084a2e2912d9625cef41f5f6732efc (pr/txstate.8 -> pr/txstate.9, compare) on top of #21207 pr/txmove.6 due to conflict with #21759, also making some suggested changes
DrahtBot removed the label
Needs rebase
on Apr 30, 2021
No need to export OutputGetChange and TxGetChange as they are not used outside of receive.cpp
I think in the future it might be good to move low-level code using IsChange logic inside receive.cpp so IsChange functions could be private. But for GetChange it seems most consistent to try to keeping exposing Get{Credit,Debit,Change} functions as a group. The fact that these two GetChange functions don’t have callers I think is more a reflection of poor unit test coverage than that change amounts should be a private part of transaction accounting.
DrahtBot added the label
Needs rebase
on May 10, 2021
S3RK
commented at 6:33 am on May 19, 2021:
contributor
Not a full review, just a small thing I’ve noticed looking at #21207
ryanofsky referenced this in commit
264b945fa7
on May 20, 2021
ryanofsky referenced this in commit
0415a53c9c
on May 20, 2021
ryanofsky force-pushed
on May 20, 2021
DrahtBot removed the label
Needs rebase
on May 20, 2021
ryanofsky
commented at 10:27 pm on May 20, 2021:
contributor
Thanks for checking this!
Rebased a5a537fd95084a2e2912d9625cef41f5f6732efc -> 3416ade015914ddeb84fad23d2455d974e9f4a74 (pr/txstate.9 -> pr/txstate.10, compare) on top of #21207 pr/txmove.7 due to conflicts
Rebased 3416ade015914ddeb84fad23d2455d974e9f4a74 -> 7cc2549759c12182063fce56161ce4403502312e (pr/txstate.10 -> pr/txstate.11, compare) on top of #21207 pr/txmove.8 due to conflicts with #17331
Rebased 7cc2549759c12182063fce56161ce4403502312e -> c2b3b4b184148447b695ff6ec56bbc2c24447655 (pr/txstate.11 -> pr/txstate.12, compare) on top of #22100 pr/txfun.1 after #21207 merge
Rebased c2b3b4b184148447b695ff6ec56bbc2c24447655 -> c00b540d3e315d52f171678e3e6d5e36211d3c38 (pr/txstate.12 -> pr/txstate.13, compare) on top of #22100 pr/txfun.2
Rebased c00b540d3e315d52f171678e3e6d5e36211d3c38 -> b71a25b492d8ded339351ed770a4360ec2316b6c (pr/txstate.13 -> pr/txstate.14, compare) on top of #22100 pr/txfun.3 due to conflict with #21866
Rebased b71a25b492d8ded339351ed770a4360ec2316b6c -> 730df28e00822f06c9fc11c86a74f764a2f5136c (pr/txstate.14 -> pr/txstate.15, compare) on top of #22100 pr/txfun.4
DrahtBot added the label
Needs rebase
on May 25, 2021
ryanofsky referenced this in commit
ed565f93e2
on May 25, 2021
ryanofsky referenced this in commit
ae93b95a68
on May 25, 2021
ryanofsky force-pushed
on May 25, 2021
DrahtBot removed the label
Needs rebase
on May 25, 2021
DrahtBot added the label
Needs rebase
on May 26, 2021
ryanofsky referenced this in commit
c7bd5842e4
on May 26, 2021
ryanofsky referenced this in commit
9ece3479c9
on May 26, 2021
meshcollider referenced this in commit
55a156fca0
on May 30, 2021
ryanofsky force-pushed
on May 30, 2021
DrahtBot removed the label
Needs rebase
on May 30, 2021
DrahtBot added the label
Needs rebase
on Jun 9, 2021
ryanofsky force-pushed
on Jun 11, 2021
DrahtBot removed the label
Needs rebase
on Jun 11, 2021
DrahtBot added the label
Needs rebase
on Jun 12, 2021
ryanofsky force-pushed
on Jun 14, 2021
DrahtBot removed the label
Needs rebase
on Jun 14, 2021
DrahtBot added the label
Needs rebase
on Jun 17, 2021
ryanofsky force-pushed
on Jun 17, 2021
DrahtBot removed the label
Needs rebase
on Jun 18, 2021
rebroad referenced this in commit
7c229d7a74
on Jun 23, 2021
in
src/wallet/transaction.h:86
in
730df28e00outdated
730df28e0082 seeing the following warnings when debug-building with debian clang 11
0./wallet/transaction.h:221:59: warning: field 'tx' will be initialized after field 'm_state'[-Wreorder-ctor] 1CWalletTx(CTransactionRef tx, const TxState& state) : tx(std::move(tx)), m_state(state)
2^ 3./wallet/transaction.h:71:16: warning: 'static' function 'TxStateInterpretSerialized' declared in header file should be declared 'static inline'[-Wunneeded-internal-declaration] 4static TxStateTxStateInterpretSerialized(TxStateUnrecognized data)
5^ 6./wallet/transaction.h:86:16: warning: 'static' function 'TxStateSerializedBlockHash' declared in header file should be declared 'static inline'[-Wunneeded-internal-declaration] 7static uint256 TxStateSerializedBlockHash(const TxState& state)
8^ 9./wallet/transaction.h:98:12: warning: 'static' function 'TxStateSerializedIndex' declared in header file should be declared 'static inline'[-Wunneeded-internal-declaration]10static int TxStateSerializedIndex(const TxState& state)
11^124 warnings generated.
DrahtBot added the label
Needs rebase
on Oct 22, 2021
ryanofsky force-pushed
on Oct 25, 2021
ryanofsky
commented at 4:18 pm on October 25, 2021:
contributor
Rebased 541d5f5c775a9aa884c1a8b37fc123933fdbd98e -> bb16e10149c4e1bf2e3d0ee027e9025cd48dd65f (pr/txstate.22 -> pr/txstate.23, compare) due to conflicts with #23288 and #23338
Rebased bb16e10149c4e1bf2e3d0ee027e9025cd48dd65f -> 3c6fdae6ed67426bd9ddb2949a9e66934f71bf0b (pr/txstate.23 -> pr/txstate.24, compare) due to conflict with #23332
DrahtBot removed the label
Needs rebase
on Oct 25, 2021
DrahtBot added the label
Needs rebase
on Oct 26, 2021
janus referenced this in commit
6856f8c5c2
on Oct 29, 2021
ryanofsky force-pushed
on Oct 29, 2021
DrahtBot removed the label
Needs rebase
on Oct 29, 2021
DrahtBot added the label
Needs rebase
on Nov 10, 2021
refactor: Make CWalletTx sync state type-safe
Current CWalletTx state representation makes it possible to set
inconsistent states that won't be handled correctly by wallet sync code
or serialized & deserialized back into the same form.
For example, it is possible to call setConflicted without setting a
conflicting block hash, or setConfirmed with no transaction index. And
it's possible update individual m_confirm and fInMempool data fields
without setting an overall consistent state that can be serialized and
handled correctly.
Fix this without changing behavior by using std::variant, instead of an
enum and collection of fields, to represent sync state, so state
tracking code is safer and more legible.
This is a first step to fixing state tracking bugs
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking,
by adding an extra margin of safety that can prevent new bugs from being
introduced as existing bugs are fixed.
d8ee8f3cd3
ryanofsky force-pushed
on Nov 15, 2021
ryanofsky
commented at 3:15 pm on November 15, 2021:
contributor
Rebased 3c6fdae6ed67426bd9ddb2949a9e66934f71bf0b -> 78c8ac87e2f585772f296b943c733bd26f255ba0 (pr/txstate.24 -> pr/txstate.25, compare) due to conflict with #22928, also making minor MakeWalletTxStatus cleanup
DrahtBot removed the label
Needs rebase
on Nov 15, 2021
meshcollider
commented at 1:42 am on November 22, 2021:
contributor
re-utACK78c8ac87e2f585772f296b943c733bd26f255ba0
maflcko requested review from promag
on Nov 22, 2021
maflcko requested review from jonatack
on Nov 22, 2021
jonatack
commented at 2:16 pm on November 22, 2021:
contributor
Concept ACK, wil review today.
in
src/wallet/rpcdump.cpp:374
in
78c8ac87e2outdated
0wallet/rpcdump.cpp:374:104: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int'in initializer list [-Wc++11-narrowing]
1 pwallet->AddToWallet(std::move(tx_ref), TxStateConfirmed{merkleBlock.header.GetHash(), height, txnIndex});
2^~~~~~~~3wallet/rpcdump.cpp:374:104: note: insert an explicit cast to silence this issue
4 pwallet->AddToWallet(std::move(tx_ref), TxStateConfirmed{merkleBlock.header.GetHash(), height, txnIndex});
5^~~~~~~~6 static_cast<int>( )
71 error generated.
ryanofsky
commented at 11:51 pm on November 23, 2021:
Ok. I don’t see how this helps readability or could help catching errors here, but I guess I’ll give benefit of the doubt and change.
0wallet/rpcdump.cpp:374:104: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int'in initializer list [-Wc++11-narrowing]
This warning doesn’t happen with either cast, so it doesn’t seem like a good reason to chose the more verbose cast.
I think when you have a specific point to make, it’s good to cite an external guideline to help make the point. But I don’t think it’s good to just parrot a guideline without saying what problem it’s addressing in the relevant context.
jonatack
commented at 11:45 am on November 24, 2021:
Yes, the developer-notes mention to follow the CppCoreGuidelines and there are some advantages to named casts (https://github.com/bitcoin/bitcoin/pull/20965#issuecomment-770375623) but I do hesitate to mention them due to the verbosity (though if casts are seen as a code smell, verbosity could be a good thing, I guess). Thanks!
in
src/wallet/wallet.h:579
in
78c8ac87e2outdated
575@@ -576,7 +576,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
576 void CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm);
577578 /** Pass this transaction to node for mempool insertion and relay to peers if flag set to true */
579- bool SubmitTxMemoryPoolAndRelay(const CWalletTx& wtx, std::string& err_string, bool relay) const;
580+ bool SubmitTxMemoryPoolAndRelay(CWalletTx& wtx, std::string& err_string, bool relay) const;
jonatack
commented at 6:55 pm on November 22, 2021:
Perhaps update the Doxygen documentation in the previous line to explain why wtx is after this change mutable / an out-param.
ryanofsky
commented at 1:06 am on November 24, 2021:
Perhaps update the Doxygen documentation in the previous line to explain why wtx is after this change mutable / an out-param.
I’ll add your text if you want to make a specific suggestion, but mentioning the wtx state update seems like an unusual detail for this summary comment to focus on when it doesn’t going into other details like this, and there are already lots of comments about refreshing the in-mempool state. Just changing this to a mutable reference already seems more straightforward than the previous version which used a const reference and mutable state member.
in
src/wallet/wallet.cpp:1644
in
78c8ac87e2outdated
jonatack
commented at 7:04 pm on November 22, 2021:
Here and elsewhere in this commit, maybe format the named args to be compatible with clang-tidy in a way consistent with current changes in the codebase (see #23546 and #23545).
Here and elsewhere in this commit, maybe format the named args to be compatible with clang-tidy in a way consistent with current changes in the codebase (see #23546 and #23545).
also, use a named cast for posInBlock
Ok, made these changes
laanwj
commented at 2:01 pm on November 23, 2021:
member
I like this refactor, it abstracts the transaction state much better than the boolean-radio-buttons, and agree it makes some kinds of mistake harder to make.
Concept and code review ACK78c8ac87e2f585772f296b943c733bd26f255ba0
re-ACKd8ee8f3cd32bbfefec931724f5798cbb088ceb6f
in
src/wallet/transaction.h:71
in
78c8ac87e2outdated
66+
67+//! Subset of states transaction sync logic is implemented to handle.
68+using SyncTxState = std::variant<TxStateConfirmed, TxStateInMempool, TxStateInactive>;
69+
70+//! Interpret TxState serialized fields as a recognized state.
71+static inline TxState TxStateInterpretSerialized(TxStateUnrecognized data)
jonatack
commented at 6:09 pm on November 23, 2021:
Seems odd to pass a TxStateUnrecognized data type for a recognized state. Edit: maybe suggest the fields are “converted from an unrecognized to recognized state.”
ryanofsky
commented at 0:05 am on November 24, 2021:
Seems odd to pass a TxStateUnrecognized data type for a recognized state. Edit: maybe suggest the fields are “converted from an unrecognized to recognized state.”
Thanks, rephrased now.
Just to explain the previous version: “Interpret TxState serialized fields as a recognized state” was supposed to be read like “Interpret serialized bytes as an integer”
in
src/wallet/transaction.h:93
in
78c8ac87e2outdated
jonatack
commented at 9:19 pm on November 23, 2021:
There appear to be remaining fInMempool comments that may need updating.
0src/wallet/wallet.cpp:1733:// We must set fInMempool here - while it will be re-set to true by the
1src/wallet/wallet.cpp-1734-// entered-mempool callback, if we did not there would be a race where a
2src/wallet/wallet.cpp-1735-// user could call sendmoney in a loop and hit spurious out of funds errors
3src/wallet/wallet.cpp-1736-// because we think that this newly generated transaction's change is
4src/wallet/wallet.cpp-1737-// unavailable as we're not yet aware that it is in the mempool.
5src/wallet/wallet.cpp-1738-//
6src/wallet/wallet.cpp:1739:// Irrespective of the failure reason, un-marking fInMempool
7src/wallet/wallet.cpp-1740-// out-of-order is incorrect - it should be unmarked when
8src/wallet/wallet.cpp-1741-// TransactionRemovedFromMempool fires.
9--10src/wallet/wallet.cpp:1973// Get the inserted-CWalletTx from mapWallet so that the
11src/wallet/wallet.cpp:1974// fInMempool flag is cached properly
ryanofsky
commented at 0:12 am on November 24, 2021:
Should these two includes be replaced by #include <variant>?
Good catch. I think these were just copied and pasted from another header. The variant type is not actually referenced so I believe no includes are necessary.
jonatack
commented at 9:26 pm on November 23, 2021:
contributor
Sorry, this is an output variable, so making this change would leave heights unset. I want to scrap this code completely after this PR (see previous review comments), but the goal for this PR is to make the smallest possible code changes in the wallet everywhere that switch to a new CWalletTx state representation without changing behavior. Then future PRs can clean up the code and nonsensical behavior in individual places like this.
jonatack
commented at 11:23 am on November 24, 2021:
Oh ok, thanks. I didn’t see that findBlock() uses height as an out-param, but now had a better look at the FoundBlock class.
ryanofsky force-pushed
on Nov 24, 2021
ryanofsky
commented at 1:26 am on November 24, 2021:
contributor
1005- wtx.m_confirm.block_height = height;
1006- } else if (wtx.isConflicted() || wtx.isConfirmed()) {
1007+ auto lookup_block = [&](const uint256& hash, int& height, TxState& state) {
1008 // If tx block (or conflicting block) was reorged out of chain
1009 // while the wallet was shutdown, change tx status to UNCONFIRMED
1010 // and reset block height, hash, and index. ABANDONED tx don't have
jonatack
commented at 11:19 am on November 24, 2021:
Should the documentation be updated here as well?
jonatack
commented at 11:48 am on November 24, 2021:
contributor
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-17 09:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me