numerrs
This commit is contained in:
@@ -510,7 +510,7 @@ UniValue MarmaraIssue(uint64_t txfee,uint8_t funcid,CPubKey receiverpk,int64_t a
|
||||
|
||||
UniValue MarmaraCreditloop(uint256 txid)
|
||||
{
|
||||
UniValue result(UniValue::VOBJ),a(UniValue::VARR); std::vector<uint256> creditloop; uint256 batontxid,createtxid,refcreatetxid,hashBlock; uint8_t funcid; int32_t i,n,numvouts,matures,refmatures; int64_t amount,refamount; CPubKey senderpk; std::string currency,refcurrency; CTransaction tx; char coinaddr[64],str[2]; struct CCcontract_info *cp,C;
|
||||
UniValue result(UniValue::VOBJ),a(UniValue::VARR); std::vector<uint256> creditloop; uint256 batontxid,createtxid,refcreatetxid,hashBlock; uint8_t funcid; int32_t err=0,i,n,numvouts,matures,refmatures; int64_t amount,refamount; CPubKey senderpk; std::string currency,refcurrency; CTransaction tx; char coinaddr[64],str[2]; struct CCcontract_info *cp,C;
|
||||
cp = CCinit(&C,EVAL_MARMARA);
|
||||
if ( (n= MarmaraGetbatontxid(creditloop,batontxid,txid)) > 0 )
|
||||
{
|
||||
@@ -522,6 +522,12 @@ UniValue MarmaraCreditloop(uint256 txid)
|
||||
{
|
||||
str[0] = funcid, str[1] = 0;
|
||||
result.push_back(Pair("funcid",str));
|
||||
if ( refcreatetxid != creditloop[0] )
|
||||
{
|
||||
fprintf(stderr,"invalid refcreatetxid, setting to creditloop[0]\n");
|
||||
refcreatetxid = creditloop[0]
|
||||
err++;
|
||||
}
|
||||
result.push_back(Pair("createtxid",refcreatetxid.GetHex()));
|
||||
result.push_back(Pair("amount",ValueFromAmount(refamount)));
|
||||
result.push_back(Pair("matures",refmatures));
|
||||
@@ -547,8 +553,11 @@ UniValue MarmaraCreditloop(uint256 txid)
|
||||
obj.push_back(Pair("receiver",coinaddr));
|
||||
Getscriptaddress(coinaddr,tx.vout[0].scriptPubKey);
|
||||
obj.push_back(Pair("nextaddress",coinaddr));
|
||||
if ( funcid == 'R' && createtxid == zeroid )
|
||||
createtxid = creditloop[i];
|
||||
if ( createtxid != refcreatetxid || amount != refamount || matures != refmatures || currency != refcurrency )
|
||||
{
|
||||
err++;
|
||||
obj.push_back(Pair("objerror",(char *)"mismatched createtxid or amount or matures or currency"));
|
||||
obj.push_back(Pair("createtxid",createtxid.GetHex()));
|
||||
obj.push_back(Pair("amount",ValueFromAmount(amount)));
|
||||
@@ -560,6 +569,7 @@ UniValue MarmaraCreditloop(uint256 txid)
|
||||
}
|
||||
}
|
||||
result.push_back(Pair("n",n));
|
||||
result.push_back(Pair("numerrors",errs));
|
||||
result.push_back(Pair("creditloop",a));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user