Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockchain 0 : in memory pool, waiting to be included in a block >=1 : this many blocks deep in the main chain

Synopsis

Declared in <wallet/wallet.h>

[[requires_capability(0x7f2e1e597cf8), requires_capability(0x7f2e11aa8ab8), requires_capability(0x7f2e169fe8a8), requires_capability(0x7f2e15f2dd48), requires_capability(0x7f2e12c6c9d8)]]
int
GetTxDepthInMainChain(CWalletTx const& wtx) const;

Description

Preconditions: it is only valid to call this function when the wallet is online and the block index is loaded. So this cannot be called by bitcoin‐wallet tool code or by wallet migration code. If this is called without the wallet being online, it won't be able able to determine the the height of the last block processed, or the heights of blocks referenced in transaction, and might cause assert failures.

Return Value

the transaction depth as described above

Parameters

Name

Description

wtx

the wallet transaction to measure

Created with MrDocs