mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Add belt-and-suspenders in DisconnectBlock
These extra variables were previously checked before the move to per-txout database.
This commit is contained in:
parent
ac52492cd2
commit
3c8a9aefff
@ -1364,6 +1364,7 @@ static DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex*
|
|||||||
for (int i = block.vtx.size() - 1; i >= 0; i--) {
|
for (int i = block.vtx.size() - 1; i >= 0; i--) {
|
||||||
const CTransaction &tx = *(block.vtx[i]);
|
const CTransaction &tx = *(block.vtx[i]);
|
||||||
uint256 hash = tx.GetHash();
|
uint256 hash = tx.GetHash();
|
||||||
|
bool is_coinbase = tx.IsCoinBase();
|
||||||
|
|
||||||
// Check that all outputs are available and match the outputs in the block itself
|
// Check that all outputs are available and match the outputs in the block itself
|
||||||
// exactly.
|
// exactly.
|
||||||
@ -1372,7 +1373,7 @@ static DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex*
|
|||||||
COutPoint out(hash, o);
|
COutPoint out(hash, o);
|
||||||
Coin coin;
|
Coin coin;
|
||||||
bool is_spent = view.SpendCoin(out, &coin);
|
bool is_spent = view.SpendCoin(out, &coin);
|
||||||
if (!is_spent || tx.vout[o] != coin.out) {
|
if (!is_spent || tx.vout[o] != coin.out || pindex->nHeight != coin.nHeight || is_coinbase != coin.fCoinBase) {
|
||||||
fClean = false; // transaction output mismatch
|
fClean = false; // transaction output mismatch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user