|
|
@ -1118,7 +1118,8 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txund |
|
|
|
txundo.vprevout.reserve(tx.vin.size()); |
|
|
|
txundo.vprevout.reserve(tx.vin.size()); |
|
|
|
BOOST_FOREACH(const CTxIn &txin, tx.vin) { |
|
|
|
BOOST_FOREACH(const CTxIn &txin, tx.vin) { |
|
|
|
txundo.vprevout.emplace_back(); |
|
|
|
txundo.vprevout.emplace_back(); |
|
|
|
inputs.SpendCoin(txin.prevout, &txundo.vprevout.back()); |
|
|
|
bool is_spent = inputs.SpendCoin(txin.prevout, &txundo.vprevout.back()); |
|
|
|
|
|
|
|
assert(is_spent); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// add outputs
|
|
|
|
// add outputs
|
|
|
@ -1358,8 +1359,8 @@ static DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex* |
|
|
|
if (!tx.vout[o].scriptPubKey.IsUnspendable()) { |
|
|
|
if (!tx.vout[o].scriptPubKey.IsUnspendable()) { |
|
|
|
COutPoint out(hash, o); |
|
|
|
COutPoint out(hash, o); |
|
|
|
Coin coin; |
|
|
|
Coin coin; |
|
|
|
view.SpendCoin(out, &coin); |
|
|
|
bool is_spent = view.SpendCoin(out, &coin); |
|
|
|
if (tx.vout[o] != coin.out) { |
|
|
|
if (!is_spent || tx.vout[o] != coin.out) { |
|
|
|
fClean = false; // transaction output mismatch
|
|
|
|
fClean = false; // transaction output mismatch
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|