mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 74fb19317a into merged_master (Bitcoin PR bitcoin/bitcoin#30849)
This commit is contained in:
commit
a7e8a376fa
17 changed files with 106 additions and 135 deletions
|
|
@ -189,17 +189,14 @@ std::optional<std::vector<int>> CalculatePrevHeights(
|
|||
prev_heights[i] = -1;
|
||||
continue;
|
||||
}
|
||||
Coin coin;
|
||||
if (!coins.GetCoin(txin.prevout, coin)) {
|
||||
if (auto coin{coins.GetCoin(txin.prevout)}) {
|
||||
prev_heights[i] = coin->nHeight == MEMPOOL_HEIGHT
|
||||
? tip.nHeight + 1 // Assume all mempool transaction confirm in the next block.
|
||||
: coin->nHeight;
|
||||
} else {
|
||||
LogPrintf("ERROR: %s: Missing input %d in transaction \'%s\'\n", __func__, i, tx.GetHash().GetHex());
|
||||
return std::nullopt;
|
||||
}
|
||||
if (coin.nHeight == MEMPOOL_HEIGHT) {
|
||||
// Assume all mempool transaction confirm in the next block.
|
||||
prev_heights[i] = tip.nHeight + 1;
|
||||
} else {
|
||||
prev_heights[i] = coin.nHeight;
|
||||
}
|
||||
}
|
||||
return prev_heights;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue