| 1357 | } |
| 1358 | |
| 1359 | void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight) |
| 1360 | { |
| 1361 | // mark inputs spent |
| 1362 | if (!tx.IsCoinBase()) { |
| 1363 | txundo.vprevout.reserve(tx.vin.size()); |
| 1364 | for (const CTxIn &txin : tx.vin) { |
| 1365 | txundo.vprevout.emplace_back(); |
| 1366 | bool is_spent = inputs.SpendCoin(txin.prevout, &txundo.vprevout.back()); |
| 1367 | assert(is_spent); |
| 1368 | } |
| 1369 | } |
| 1370 | // add outputs |
| 1371 | AddCoins(inputs, tx, nHeight); |
| 1372 | } |
| 1373 | |
| 1374 | void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight) |
| 1375 | { |