From f6c647ed5f22141ad3f0fa9d101c9a5d01be26b5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 29 Oct 2016 17:44:35 -0300 Subject: [PATCH] test --- src/miner.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 2a1fe6570..0c7cc3f10 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -437,14 +437,25 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) { - CPubKey pubkey; CScript scriptPubKey; - if (!reservekey.GetReservedKey(pubkey)) - return NULL; + CPubKey pubkey; CScript scriptPubKey; uint8_t *script,*ptr; int32_t i; if ( USE_EXTERNAL_PUBKEY != 0 ) { //fprintf(stderr,"use notary pubkey\n"); scriptPubKey = CScript() << ParseHex(NOTARY_PUBKEY) << OP_CHECKSIG; - } else scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; + } + else + { + if (!reservekey.GetReservedKey(pubkey)) + return NULL; + scriptPubKey.resize(35); + ptr = (uint8_t *)pubkey.data(); + script = (uint8_t *)scriptPubKey.data(); + script[0] = 33; + for (i=0; i<33; i++) + script[i+1] = ptr[i]; + script[34] = OP_CHECKSIG; + //scriptPubKey = CScript() << ToByteVector(pubkey) << OP_CHECKSIG; + } return CreateNewBlock(scriptPubKey); }