Another update commit b338c797fd8817445d4db1997f9ffcb730f072be
: Fix Checkpoint test, fix rpcmining bug v9.3 uses CScriptNum, cleanup BIP30/16 comments & set epoch to match v8 nodes
https://github.com/GroundRod/IXCoin/commit/b338c797fd8817445d4db1997f9ffcb730f072beAfter more consideration, have set the BIP30 value back to what Ahmed had originally, this time with a correct date/time comment for the event, this should match what v8 nodes are doing, if anyone has a better idea, please chime in....
The code at just after line 2000 in main.cpp now looks like this:
// Do not allow blocks that contain transactions which 'overwrite' older transactions,
// unless those are already completely spent.
// If such overwrites are allowed, coinbases and transactions depending upon those
// can be duplicated to remove the ability to spend the first instance -- even after
// being sent to another address.
// See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information.
// This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
// already refuses previously-known transaction ids entirely.
// For Bitcoin, this rule was originally applied all blocks whose timestamp was after March 15, 2012, 0:00 UTC.
// Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the
// two in the chain that violate it.
//
// GR Note: Ixcoin has no such two blocks, that I am aware of. The epoch 1388624831 has been
// arbitrarily picked while developing v8, so in order to remain compatible with those v8 nodes
// now running on the network, our v9 core will continue to have the same & remain compatible.
//
// This prevents exploiting the issue against nodes in their initial block download.
//
// This rule applies to all IXCoin blocks whose timestamp is after 1388624831.
//
// BIP30 for IXCOIN has gone into effect on 02 Jan 2014 01:07:11 GMT
// Code Updated on: 1/27/2015 by GroundRod
// Generated from: http://www.epochconverter.com/
// Epoch timestamp: 1388624831
// Human time: Thu, 02 Jan 2014 01:07:11 GMT
int64_t nBIP30SwitchTime = 1388624831;
bool fEnforceBIP30 = (!pindex->phashBlock) || (pindex->nTime > nBIP30SwitchTime);
if (fEnforceBIP30) {
for (unsigned int i = 0; i < block.vtx.size(); i++) {
uint256 hash = block.GetTxHash(i);
if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned())
return state.DoS(100, error("ConnectBlock() : tried to overwrite transaction"), REJECT_INVALID, "bad-txns-BIP30");
}
}
// As well, BIP16 didn't become active for Ixcoin, until 02 Jan 2014 01:07:11 GMT
int64_t nBIP16SwitchTime = 1388624831;
bool fStrictPayToScriptHash = (pindex->nTime >= nBIP16SwitchTime);
@mmpool - Now that I'm starting to understand the changes you've been making to allow the mining test to proceed, will not be putting those into our main development branch, but only on a local build to conduct the test. The above BIP30, checkpoints, starting merge mining block and other references needing to be disabled for the test, will have to be done, after cloning or pulling the latest source.
What might help you on the test though, was a repair I just found & made in rpcmining.cpp, an important line had been commented out and so we were not building the block vtx[0].vin[0].ScriptSig in getauxblock(), this was due to upgrading from v9.2.1, and the removal of CBigNum references in creating CScript objects. Hopefully this change, will now work fine there...
- // FIXME: Debugging 9.3 upgrade build problem, commenting out this line fixed it (GR)
- // the problem is related to use of CBigNum, they are no longer referenced in script objects
- //pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nBits << CBigNum(1) << OP_2;
+ pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nBits << CScriptNum(1) << OP_2;
As there was no reference for me to work from on auxpow while upgrading, we need to be watching carefully CBigNum usage in various parts of that merged-mining code. As I recall, that was the only spot which had caused me a compile error though, and gone unfixed, until now.
GR