-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Replace SignatureHash() with class TxSignatureHasher #4989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This could continue with https://github.com/jtimon/bitcoin/tree/sighash2 and https://github.com/jtimon/bitcoin/tree/sighash3 or simply https://github.com/jtimon/bitcoin/tree/sighash_abstract. With an abstract class the libscript could use a minimal duplicated version of CTransaction if we decide to do that, probably only temporarily, until core is more divided (again, if we decide that including the whole core.o in libscript is too much right now). |
#include <vector> | ||
#include <stdint.h> | ||
#include <string> | ||
|
||
class uint256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This should stay at the end.
May I suggest changing the copyright (in the files header) of edited files directly to be just MIT :)? |
I think all nits belong to #4890 but I will happily rebase on top of a corrected version. |
6312eef
to
7ffba23
Compare
Mhmm, @theuni one of the tests builds didn't failed when it had to https://travis-ci.org/bitcoin/bitcoin/builds/36618762 |
It failed to compile... |
@sipa, I know and I fixed that, but the travis builds should had all failed due to the compiling error, but build 5/7 didn't failed. So maybe there's something wrong with it, I don't know. |
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4989_7ffba2382622ec9529cdd318cc12bc50ebf5b0b3/ for binaries and test log. |
Yes, OSX doesn't build the tests because they can't run there (it's a cross build from Linux). I figured we had enough builders handling the tests, so instead the OSX spends its time testing the dmg packing process. I'd be fine with switching the tests on so that they build if you guys would prefer that, but I'm not sure it would do much for us. |
It's fine, I thought you may not be aware of this or something. Thanks for the explanation. |
@jtimon Thanks, you were right to point it out. The tests were created somewhat arbitrarily, I assumed they would be ever-evolving. If you think something needs more coverage, by all means mention it :) |
Here's another version of this PR built on top of #5054 : https://github.com/jtimon/bitcoin/tree/sighash_explicit |
Changed the class name from SignatureHasher to TxSignatureHasher |
Went back to being independent from #4981 since the rebase is straight forward anyway. Now the original SignatureHash function is maintained but renamed and moved to the anonymous namespace. |
Always instantiate a new CTransaction in TxSignatureHasher's constructor and not only when a CMutableTransaction is provided as suggested by @laanwj. |
Closing until at least 0.10 |
Is built on top of #4890.
May interfere with #4981.