From 635602d51982f81fb3809b01c949b6eadf1efa7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 11 Jul 2019 00:40:06 -1100 Subject: [PATCH] Off by 1 --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 16378c592..c11c4e7b2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -7007,7 +7007,7 @@ UniValue faucetfund(const UniValue& params, bool fHelp) cp = CCinit(&C,EVAL_FAUCET); v = MakeCC1vout(EVAL_FAUCET,funds,GetUnspendable(cp,0)); Getscriptaddress(coinaddr,CScript() << ParseHex(HexStr(pubkey2pk(Mypubkey()))) << OP_CHECKSIG); - return(NSPV_spend(coinaddr,(char *)HexStr(v.scriptPubKey.begin(),v.scriptPubKey.end()).c_str(),funds)); + return(NSPV_spend(coinaddr,(char *)HexStr(v.scriptPubKey.begin()+1,v.scriptPubKey.end()-1).c_str(),funds)); } if ( ensure_CCrequirements(EVAL_FAUCET) < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");