MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetTxDepthInMainChain

Method GetTxDepthInMainChain

src/wallet/wallet.cpp:3326–3336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3324}
3325
3326int CWallet::GetTxDepthInMainChain(const CWalletTx& wtx) const
3327{
3328 AssertLockHeld(cs_wallet);
3329 if (auto* conf = wtx.state<TxStateConfirmed>()) {
3330 return GetLastBlockHeight() - conf->confirmed_block_height + 1;
3331 } else if (auto* conf = wtx.state<TxStateConflicted>()) {
3332 return -1 * (GetLastBlockHeight() - conf->conflicting_block_height + 1);
3333 } else {
3334 return 0;
3335 }
3336}
3337
3338int CWallet::GetTxBlocksToMaturity(const CWalletTx& wtx) const
3339{

Callers 11

feebumper.cppFile · 0.80
spend.cppFile · 0.80
CachedTxIsTrustedFunction · 0.80
GetBalanceFunction · 0.80
GetAddressBalancesFunction · 0.80
MakeWalletTxStatusFunction · 0.80
getCoinsMethod · 0.80
coins.cppFile · 0.80
WalletTxToJSONFunction · 0.80
transactions.cppFile · 0.80
listsinceblockFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected