wallet: remove redundant Assert call when block is disconnected

It was highlighted in a PR discussion previously that the recently
moved `Assert` macro call inside the block disconnected loop had
been redundant for quite a while because of the presence of the
`assert` macro call at the start of the function. Therefore, it
is removed now.

refs #https://github.com/bitcoin/bitcoin/pull/31757#discussion_r1995416821
This commit is contained in:
rkrux 2025-03-27 16:21:54 +05:30
parent a54baa8698
commit ae6b6ea296
No known key found for this signature in database
GPG key ID: 8614B8BD2E144C6D

View file

@ -1549,7 +1549,7 @@ void CWallet::blockDisconnected(const interfaces::BlockInfo& block)
int disconnect_height = block.height; int disconnect_height = block.height;
for (size_t index = 0; index < block.data->vtx.size(); index++) { for (size_t index = 0; index < block.data->vtx.size(); index++) {
const CTransactionRef& ptx = Assert(block.data)->vtx[index]; const CTransactionRef& ptx = block.data->vtx[index];
// Coinbase transactions are not only inactive but also abandoned, // Coinbase transactions are not only inactive but also abandoned,
// meaning they should never be relayed standalone via the p2p protocol. // meaning they should never be relayed standalone via the p2p protocol.
SyncTransaction(ptx, TxStateInactive{/*abandoned=*/index == 0}); SyncTransaction(ptx, TxStateInactive{/*abandoned=*/index == 0});