From fc1e3209fd01a2a2b1f4f9ea2a8ee730a18a5619 Mon Sep 17 00:00:00 2001 From: dimxy Date: Fri, 26 Apr 2019 01:09:51 +0500 Subject: [PATCH] more relaxed validation --- src/cc/prices.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 50115924a..85abc985c 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -375,9 +375,10 @@ bool PricesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx if (CheckPricesOpret(vintx, vintxOpret) == 0) return eval->Invalid("cannot find prices opret in vintx"); - //if (vintxOpret.begin()[1] == 'B' && prevoutN == 3) { - // return eval->Invalid("cannot spend bet marker"); - //} + if (funcId != 'F' && vintxOpret.begin()[1] == 'B' && prevoutN == 1) { + //return eval->Invalid("cannot spend bet marker"); + std::cerr << "PricesValidate() " << " non-final tx cannot spend cc marker vout=" << prevoutN << std::endl; + } if (!foundFirst) { prevoutN = vin.prevout.n; @@ -412,7 +413,8 @@ bool PricesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx } if (prevoutN != 0) { // check spending rules - return eval->Invalid("incorrect vintx vout to spend"); + // return eval->Invalid("incorrect vintx vout to spend"); + std::cerr << "PricesValidate() " << "add fund tx incorrect vout to spend=" << prevoutN << std::endl; } break; @@ -432,8 +434,9 @@ bool PricesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx return false; if (!ValidateBetTx(cp, eval, firstVinTx)) return false; - if (prevoutN != 2) { // check spending rules - return eval->Invalid("incorrect vout to spend"); + if (prevoutN != 1) { // check spending rules + // return eval->Invalid("incorrect vout to spend"); + std::cerr << "PricesValidate() "<< "final tx incorrect vout to spend=" << prevoutN << std::endl; } break;