| 159 | CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE); |
| 160 | |
| 161 | CBlockIndex* CChainState::FindForkInGlobalIndex(const CBlockLocator& locator) const |
| 162 | { |
| 163 | AssertLockHeld(cs_main); |
| 164 | |
| 165 | // Find the latest block common to locator and chain - we expect that |
| 166 | // locator.vHave is sorted descending by height. |
| 167 | for (const uint256& hash : locator.vHave) { |
| 168 | CBlockIndex* pindex{m_blockman.LookupBlockIndex(hash)}; |
| 169 | if (pindex) { |
| 170 | if (m_chain.Contains(pindex)) { |
| 171 | return pindex; |
| 172 | } |
| 173 | if (pindex->GetAncestor(m_chain.Height()) == m_chain.Tip()) { |
| 174 | return m_chain.Tip(); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | return m_chain.Genesis(); |
| 179 | } |
| 180 | |
| 181 | bool CheckInputScripts(const CTransaction& tx, TxValidationState& state, |
| 182 | const CCoinsViewCache& inputs, unsigned int flags, bool cacheSigStore, |
no test coverage detected