Page MenuHomePhabricator

Merge #10537: Few Minor per-utxo assert-semantics re-adds and tweak

Authored by nakihito on Jul 3 2019, 21:43.



9417d7a33 Be much more agressive in AccessCoin docs. (Matt Corallo)
f58349ca8 Restore some assert semantics in sigop cost calculations (Matt Corallo)
3533fb4d3 Return a bool in SpendCoin to restore pre-per-utxo assert semantics (Matt Corallo)
ec1271f2b Remove useless mapNextTx lookup in CTxMemPool::TrimToSize. (Matt Corallo)

Tree-SHA512: 158a4bce063eac93e1d50709500a10a7cb1fb3271f10ed445d701852fce713e2bf0da3456088e530ab005f194ef4a2adf0c7cb23226b160cecb37a79561f29ca

Backport of Core PR10537

Test Plan
make check

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 6658
Build 11363: Bitcoin ABC Teamcity Staging
Build 11362: arc lint + arc unit

Event Timeline

nakihito created this revision.Jul 3 2019, 21:43
Owners added a reviewer: Restricted Owners Package.Jul 3 2019, 21:43
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 3 2019, 21:43
nakihito planned changes to this revision.Jul 3 2019, 21:43
nakihito requested review of this revision.Jul 5 2019, 18:44

coins.cpp changes were previously made here:
consensus/tx_verify.cpp changes were made here: (note: GetTransactionSigOpCost() was never added)
validation.cpp changes made here: and here:

Fabien requested changes to this revision.Jul 5 2019, 21:25

The changes to consensus/tx_verify.cpp need to be backported. It's not in our codebase.

This revision now requires changes to proceed.Jul 5 2019, 21:25
nakihito added a comment.Jul 5 2019, 23:11
In D3542#84072, @Fabien wrote:

The changes to consensus/tx_verify.cpp need to be backported. It's not in our codebase.

The first change to consensus/tx_verify.cpp to GetP2SHSigOpCount() is already there. Its been turned into the function .GetOutputFor():

  const CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn &input) const {
	    const Coin &coin = AccessCoin(input.prevout);
	    return coin.GetTxOut();

The second change is to GetTransactionSigOpCost() but that should have been added in D1739. See for comparison.

nakihito requested review of this revision.Sep 6 2019, 17:16
Fabien accepted this revision.Sep 9 2019, 09:16
This revision is now accepted and ready to land.Sep 9 2019, 09:16