MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetTxDepthInMainChain

Method GetTxDepthInMainChain

src/wallet/wallet.cpp:3347–3359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3345}
3346
3347int CWallet::GetTxDepthInMainChain(const CWalletTx& wtx) const
3348{
3349 AssertLockHeld(cs_wallet);
3350 if (auto* conf = wtx.state<TxStateConfirmed>()) {
3351 assert(conf->confirmed_block_height >= 0);
3352 return GetLastBlockHeight() - conf->confirmed_block_height + 1;
3353 } else if (auto* conf = wtx.state<TxStateBlockConflicted>()) {
3354 assert(conf->conflicting_block_height >= 0);
3355 return -1 * (GetLastBlockHeight() - conf->conflicting_block_height + 1);
3356 } else {
3357 return 0;
3358 }
3359}
3360
3361int CWallet::GetTxBlocksToMaturity(const CWalletTx& wtx) const
3362{

Callers 11

feebumper.cppFile · 0.80
FetchSelectedInputsFunction · 0.80
AvailableCoinsFunction · 0.80
GetBalanceFunction · 0.80
GetAddressBalancesFunction · 0.80
interfaces.cppFile · 0.80
getCoinsMethod · 0.80
coins.cppFile · 0.80
sendallFunction · 0.80
transactions.cppFile · 0.80
listsinceblockFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected