Direct CCoins references

To prevent excessive copying of CCoins in and out of the CCoinsView
implementations, introduce a GetCoins() function in CCoinsViewCache
with returns a direct reference. The block validation and connection
logic is updated to require caching CCoinsViews, and exploits the
GetCoins() function heavily.
This commit is contained in:
Pieter Wuille
2012-07-08 19:04:05 +02:00
parent 64dd46fd05
commit 13c51f20f6
3 changed files with 67 additions and 61 deletions

View File

@ -256,9 +256,6 @@ BOOST_AUTO_TEST_CASE(test_GetThrow)
t1.vout.resize(2);
t1.vout[0].nValue = 90*CENT;
t1.vout[0].scriptPubKey << OP_1;
BOOST_CHECK_THROW(t1.AreInputsStandard(coinsDummy), runtime_error);
BOOST_CHECK_THROW(t1.GetValueIn(coinsDummy), runtime_error);
}
BOOST_AUTO_TEST_SUITE_END()