Correct AuxPoW coinbase script concatenation operators.

MakeCoinbaseWithAux() was incorrectly using << to add a CScript onto a
CScript instead of the + operator. Operators corrected and structure
now more closely reflects coinbase script assembly done elsewhere.
This commit is contained in:
Ross Nicoll 2014-08-17 12:09:40 +01:00
parent 223ed2eadd
commit 23bcb1bbd2
No known key found for this signature in database
GPG key ID: 9142E5F7E533CE3B

View file

@ -109,8 +109,12 @@ CScript MakeCoinbaseWithAux(unsigned int nHeight, unsigned int nExtraNonce, vect
vector<unsigned char> vchAuxWithHeader(UBEGIN(pchMergedMiningHeader), UEND(pchMergedMiningHeader));
vchAuxWithHeader.insert(vchAuxWithHeader.end(), vchAux.begin(), vchAux.end());
CScript script = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
// Push OP_2 just in case we want versioning later
return CScript() << nHeight << CScriptNum(nExtraNonce) << COINBASE_FLAGS << OP_2 << vchAuxWithHeader;
script = script << OP_2 << vchAuxWithHeader;
return script;
}