From 3e30e9e4dca21b08b499780a0bf1d606165bb5ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 25 Aug 2018 09:01:05 -1100 Subject: [PATCH] Prevent unlocking fundingtxid --- src/cc/rewards.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index d3d374613..33c5f01d4 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -244,7 +244,9 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t //vout.0: funding CC change or recover normal payout //vout.1: normal output to unlock address //vout.n-1: opreturn 'U' sbits fundingtxid - if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 ) + if ( fundingtxid == txid ) + return eval->Invalid("cant unlock fundingtxid"); + else if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 ) return eval->Invalid("always should find vin.0, but didnt"); for (i=0; i