Sizeof() returned the size of a pointer instead of the size of the buffer.
Fixes issue #1924.
Actually, I don't think it's this simple. With the new height-in-coinbase requirement, I expect either this can be left alone/null, or we need to put a height in there. I would have expected the latter, but it's obviously working right now for some (unknown to me) reason...
It certainly cannot be left alone. Right now the dummy script is four bytes on 32 bit systems and eight bytes on 64 bit systems, and may contain undefined data (possible information leak or crash), which is obviously wrong.
If two bytes is not the right size, what is? (If eight bytes is working, safest may be to just fix it to eight zero bytes)
RE: Luke-Jr's comment:
Should be scriptSig = CScript() << (pindexPrev->nHeight + 1) I suppose...
This solution breaks the autotester:
pblock->vtx[0].vin[0].scriptSig = CScript((short)0);
With the following error:
Running 70 test cases...
unknown location(0): fatal error in "CreateNewBlock_validity": std::runtime_error: CreateNewBlock() : ConnectBlock failed
test/miner_tests.cpp(58): last checkpoint
So I went with:
pblock->vtx[0].vin[0].scriptSig = CScript() << OP_0 << OP_0;
This does pass all the tests.
Adding the depth should IMO be another pull, this one just fixes the immediate reported issue.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/a0ef4e1ee9807b9b553606778ba0884f3e602520 for binaries and test log.
It's scary that only @BitcoinPullTester is active in the project, what's up? Did I miss something?
Everything (at least core changes) are in hibernation waiting for ultraprune (#1677) to be merged :smile_cat:
That patch scares me even more ^^...
It is scary, but it is a necessity. It helps against some long-running performance issues and will allow for new features. We can make it somewhat less scary by testing and reviewing it extensively, that's why other things are on hold.
Sizeof() returned the size of a pointer instead of the size of the buffer.
Fixes issue #1924.
Rebased, can be merged again
ACK
ACK