Page MenuHomePhabricator

Cleaned up last usages of nHashType
ClosedPublic

Authored by jasonbcox on Jan 17 2018, 19:31.

Details

Summary

Final cleanup work to complete T61.

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1649
Build 1649: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Jan 17 2018, 21:47
deadalnix added inline comments.
src/test/sighash_tests.cpp
145 ↗(On Diff #2566)

Keep the raw integer in here. You don't want SigHashType involved at all on this codepath. This ensures no information is lost in the process.

This revision now requires changes to proceed.Jan 17 2018, 21:47
jasonbcox added inline comments.
src/test/sighash_tests.cpp
145 ↗(On Diff #2566)

Fair point. I reverted all changes in this function, since it didn't make sense to keep sigHashType and nHashType side-by-side. Not to mention it wouldn't make sense to call RandomTransaction() using sigHashType for the same reason as you stated for SignatureHashOld().

reverted changes around SignatureHashOld() to ensure no information loss

deadalnix requested changes to this revision.Jan 17 2018, 23:48
deadalnix added inline comments.
src/test/sighash_tests.cpp
134

Arguably, you should add

SigHashType sigHashType(nHashType);
137

sigHashType = sigHashType.withForkId(true);

146

Remove constructor.

This revision now requires changes to proceed.Jan 17 2018, 23:48
jasonbcox marked 3 inline comments as done.

Added back SigHashType ops

This revision is now accepted and ready to land.Jan 18 2018, 02:08
This revision was automatically updated to reflect the committed changes.