diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index e643ee9e1..d6ede2d52 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -539,7 +539,10 @@ uint64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbi { char coinaddr[64]; uint64_t sbits,nValue,totalinputs = 0; uint256 hash,txid,proof,hashBlock,fundingtxid; CScript fundingPubKey; CTransaction tx,vinTx; int32_t vout,first=0,n=0; uint8_t funcid; std::vector > unspentOutputs; - fundingPubKey = CScript() << ParseHex(HexStr(dicepk)) << OP_CHECKSIG; + if ( GetTransaction(reffundingtxid,tx,hashBlock,false) != 0 && tx.vout.size() > 1 && ConstrainVout(tx.vout[0],1,cp->unspendableCCaddr,0) != 0 ) + { + fundingPubKey = tx.vout[1].scriptPubKey; + } else return(0); GetCCaddress(cp,coinaddr,dicepk); SetCCunspents(unspentOutputs,coinaddr); entropyval = 0;