Some wallet calls (like getbalances) need to lock the chainstate to make sure they are caught up on the latest block (which may have been reported to the users in getblockchaininfo or similar).

Those calls could benefit if the block hash they were valid on was included in the response. For example, immature balance can only change when the chainstate changes. (Assuming no keys are imported)

It seems those calls can include the block hash they are caught up with for free in the response. They could simply include `m_last_block_processed` in the response.

I haven't checked back with other developers to see if they like this approach, but to start simple only a single call could be updated for now. E.g. `getbalances`.

#### Useful skills:

Basic understanding of threads, the Bitcoin Core wallet and the Bitcoin Core RPC interface.

#### Want to work on this issue?

The purpose of the `good first issue` label is to highlight which issues are suitable for a new contributor without a deep understanding of the codebase.

You do not need to request permission to start working on this. You are encouraged to comment on the issue if you are planning to work on it. This will help other contributors monitor which issues are actively being addressed and is also an effective way to request assistance if and when you need it.

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

{
    return{{RPCResult::Type::NUM, "confirmations", "The number of confirmations for the transaction. Negative confirmations means the\n"
               "transaction conflicted that many blocks ago."},
           {RPCResult::Type::BOOL, "generated", true, "Only present if the transaction's only input is a coinbase one."},
           {RPCResult::Type::BOOL, "trusted", true, "Whether we consider the transaction to be trusted and safe to spend from.\n"
                "Only present when the transaction has 0 confirmations (or negative confirmations, if conflicted)."},
           {RPCResult::Type::STR_HEX, "blockhash", true, "The block hash containing the transaction."},
           {RPCResult::Type::NUM, "blockheight", true, "The block height containing the transaction."},
           {RPCResult::Type::NUM, "blockindex", true, "The index of the transaction in the block that includes it."},
           {RPCResult::Type::NUM_TIME, "blocktime", true, "The block time expressed in " + UNIX_EPOCH_TIME + "."},
           {RPCResult::Type::STR_HEX, "txid", "The transaction id."},
           {RPCResult::Type::STR_HEX, "wtxid", "The hash of serialized transaction, including witness data."},
           {RPCResult::Type::ARR, "walletconflicts", "Conflicting transaction ids.",
           {
               {RPCResult::Type::STR_HEX, "txid", "The transaction id."},
           }},
           {RPCResult::Type::STR_HEX, "replaced_by_txid", true, "The txid if this tx was replaced."},
           {RPCResult::Type::STR_HEX, "replaces_txid", true, "The txid if the tx replaces one."},
           {RPCResult::Type::STR, "to", true, "If a comment to is associated with the transaction."},
           {RPCResult::Type::NUM_TIME, "time", "The transaction time expressed in " + UNIX_EPOCH_TIME + "."},
           {RPCResult::Type::NUM_TIME, "timereceived", "The time received expressed in " + UNIX_EPOCH_TIME + "."},
           {RPCResult::Type::STR, "comment", true, "If a comment is associated with the transaction, only present if not empty."},
           {RPCResult::Type::STR, "bip125-replaceable", "(\"yes|no|unknown\") Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.\n"
               "May be unknown for unconfirmed transactions not in the mempool because their unconfirmed ancestors are unknown."},
           {RPCResult::Type::ARR, "parent_descs", true, "Only if 'category' is 'received'. List of parent descriptors for the scriptPubKey of this coin.", {
               {RPCResult::Type::STR, "desc", "The descriptor string."},
           }},
           };
}
RPCHelpMan listtransactions()