| 3345 | } |
| 3346 | |
| 3347 | int 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 | |
| 3361 | int CWallet::GetTxBlocksToMaturity(const CWalletTx& wtx) const |
| 3362 | { |
no outgoing calls
no test coverage detected