diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index 363b54ad5..2d64e9a4f 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -64,7 +64,7 @@ int32_t has_opret(const CTransaction &tx, uint8_t evalcode) for ( auto vout : tx.vout ) { //fprintf(stderr, "[txid.%s] 1.%i 2.%i 3.%i 4.%i\n",tx.GetHash().GetHex().c_str(), vout.scriptPubKey[0], vout.scriptPubKey[1], vout.scriptPubKey[2], vout.scriptPubKey[3]); - if ( vout.scriptPubKey[0] == OP_RETURN && vout.scriptPubKey[2] == evalcode ) + if ( vout.scriptPubKey.size() > 2 && vout.scriptPubKey[0] == OP_RETURN && vout.scriptPubKey[2] == evalcode ) return i; i++; } diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 12d5cff62..498d9d014 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -595,7 +595,7 @@ int64_t AddPaymentsInputs(bool fLockedBlocks,int8_t GetBalance,struct CCcontract } } } - if ( GetBalance == 3 && totalinputs < minrelease ) // return elegible balance to be spent, and blocks left until min release can be released. + if ( GetBalance == 3 && totalinputs < minrelease*COIN ) // return elegible balance to be spent, and blocks left until min release can be released. { int64_t lockedblocks_balance = totalinputs; // inputs that can be spent already. // sort utxos by blocks until able to be spent, smallest at top.