MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / UpdateCoins

Function UpdateCoins

src/validation.cpp:1359–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1357}
1358
1359void 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
1374void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
1375{

Callers 3

ConnectBlockMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

AddCoinsFunction · 0.85
SpendCoinMethod · 0.80
IsCoinBaseMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68