|
|
@ -878,6 +878,7 @@ UniValue submitblock(const UniValue& params, bool fHelp) |
|
|
|
); |
|
|
|
|
|
|
|
CBlock block; |
|
|
|
//LogPrintStr("Hex block submission: " + params[0].get_str());
|
|
|
|
if (!DecodeHexBlk(block, params[0].get_str())) |
|
|
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); |
|
|
|
|
|
|
@ -903,6 +904,7 @@ UniValue submitblock(const UniValue& params, bool fHelp) |
|
|
|
CValidationState state; |
|
|
|
submitblock_StateCatcher sc(block.GetHash()); |
|
|
|
RegisterValidationInterface(&sc); |
|
|
|
//printf("submitblock, height=%d, coinbase sequence: %d, scriptSig: %s\n", chainActive.LastTip()->GetHeight()+1, block.vtx[0].vin[0].nSequence, block.vtx[0].vin[0].scriptSig.ToString().c_str());
|
|
|
|
bool fAccepted = ProcessNewBlock(1,chainActive.LastTip()->GetHeight()+1,state, NULL, &block, true, NULL); |
|
|
|
UnregisterValidationInterface(&sc); |
|
|
|
if (fBlockPresent) |
|
|
|