Hey,
I wanna help you guys by solving a problem,
If your confirmations are going to fast (sometimes x100 faster than blocks mined) than you have to lower the coin maturity, i still didn't find out why this is happening and i will soon test other coin maturity amounts, but i know 100 is not working proberly and 10 does.
after months of searching and trying things out i managed to get a good working coin on version 0.18.1 (windows included).
(thx TheWolf666 for helping me with the segwit and IsNullDummyEnabled problem that fixed the transactions that stay forever in memory pool
(For the people that come here for the same problem under here you can see a copy of a piece out of the tutorial to fix this problem
Validation.cpp is not finished yet. We have a problem with SEGWIT. It cannot work at height 1. So in the beginning, we need to disable some checks, that will have to be re-enabled when the blockchain has at least 2000 blocks mined. You have to experiment here; the goal of this tutorial is not to deal with the blockchain maintenance.
bool IsWitnessEnabled needs to return true in all cases. So just add return true; at the beginning of the function.
IsNullDummyEnabled has the same problem, do the same to that function.
Find this “return state.DoS(100, false, REJECT_INVALID, "bad-cb-height", false, "block height mismatch in coinbase");” and comment it.
End of the validation.cpp customization.
h) Other code modifications.
There are more modifications, spread everywhere that needs to be fixed in order to get the coin to work correctly.
validation.h :
- you need to change the DEFAULT_MAX_TIP_AGE to something very large (60*60*24*365 for example). This is temporary. This is the interval when the blockchain is not mining. At starting you might have a genesis made long time ago, and not have mined for a while, so that this has to be changed or your Coin will not work.
- DEFAULT_CHECKPOINTS_ENABLED = true; needs to be changed to false, or your coin will try to verify that you are on the Bitcoin blockchain, which you are not.
\rpc\mining.cpp :
Another SEGWIT test that needs to be removed:
Code:
throw JSONRPCError(RPC_INVALID_PARAMETER, "getblocktemplate must be called with the segwit rule set (call with {\"rules\": [\"segwit\"]})");
Comment this line.
net_processing.cpp :
- STALE_CHECK_INTERVAL need to be changed to a large value to avoid having a STALE error, this is again temporary, once the blockchain is mined by many people, it can be back to the original values. (3600*24*365 for example)
- STALE_RELAY_AGE_LIMIT same for this static variable.
\qt\bitcoingui.cpp
Get rid of the loading form set this variable to 0.
Code:
qint64 secs = blockDate.secsTo(currentDate);
becomes qint64 secs=0;
Now you should have a functional Coin. But you need to mine.
Greetings,
Jonas Bellaert