Follow-up to:
commit 700c42b85d20e624bef4228eef062c93084efab5, which replaced pIndex with block_hash in AddToWalletIfInvolvingMe.
commit 9700fcb47feca9d78e005b8d18b41148c8f6b25f, which replaced posInBlock with confirm.nIndex.
Follow-up to:
commit 700c42b85d20e624bef4228eef062c93084efab5, which replaced pIndex with block_hash in AddToWalletIfInvolvingMe.
commit 9700fcb47feca9d78e005b8d18b41148c8f6b25f, which replaced posInBlock with confirm.nIndex.
161 | @@ -162,7 +162,8 @@ class CWalletTx 162 | int block_height; 163 | uint256 hashBlock; 164 | int nIndex; 165 | - Confirmation(Status s = UNCONFIRMED, int b = 0, uint256 h = uint256(), int i = 0) : status(s), block_height(b), hashBlock(h), nIndex(i) {} 166 | + Confirmation(Status s = UNCONFIRMED, int block_height = 0, uint256 block_hash = uint256(), int block_index = 0)
Could rename s to status here as well
Done
Follow-up to:
* commit 700c42b85d20e624bef4228eef062c93084efab5, which replaced pIndex
with block_hash in AddToWalletIfInvolvingMe.
* commit 9700fcb47feca9d78e005b8d18b41148c8f6b25f, which replaced
posInBlock with confirm.nIndex.
284 | @@ -285,8 +285,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati 285 | 286 | void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); 287 | 288 | - /* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. 289 | - * Should be called with non-zero block_hash and posInBlock if this is for a transaction that is included in a block. */ 290 | + /** Should be called with non-zero block_hash and block_index if this is for a transaction that is included in a block. */
I think this comment is slightly confusing. There are no block_hash and block_index parameters. Maybe add confirm. in front?
I've removed the comment. CWalletTx::Confirmation is self-explanatory in that regard.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
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.
Code review ACK fa8fef6ef2287cd36ae14fbf10e852ddef7e62ac
cc Ryan @ryanofsky
284 | @@ -285,8 +285,6 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati 285 | 286 | void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); 287 | 288 | - /* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. 289 | - * Should be called with non-zero block_hash and posInBlock if this is for a transaction that is included in a block. */
In commit "doc: Fix CWalletTx::Confirmation doc" (fa8fef6ef2287cd36ae14fbf10e852ddef7e62ac)
Minor: This comment does seem useful to me and I'd probably s/non-zero block_hash and posInBlock/confirmation/ instead of dropping it.
This is already explained in the Confirmation doc:
/** Confirmation includes tx status and a triplet of {block height/block hash/tx index in block} ...
If you think this is important to explain, it might be better to put the comment to TxStateConfirmed from #21206?