Add the transaction to the wallet, wrapping it up inside a CWalletTx

Synopsis

Declared in <wallet/wallet.h>

CWalletTx*
AddToWallet(
    CTransactionRef tx,
    TxState const& state,
    UpdateWalletTxFn const& update_wtx = nullptr,
    bool rescanning_old_block = false);

Return Value

the recently added wtx pointer or nullptr if there was a db write error.

Parameters

Name

Description

tx

the transaction to add

state

the chain state (block or mempool) in which the transaction was seen

update_wtx

optional callback to update the wallet transaction metadata

rescanning_old_block

true if the transaction was found during a rescan of old blocks

Created with MrDocs