This commit is contained in:
dimxy
2019-04-15 22:37:26 +05:00
parent 505619e202
commit b7756c071b

View File

@@ -464,7 +464,7 @@ int64_t prices_costbasis(CTransaction bettx)
} }
// calculates added bet total, returns the last baton txid // calculates added bet total, returns the last baton txid
int64_t prices_batontxid(uint256 &batontxid,CTransaction bettx,uint256 bettxid) int64_t prices_batontxid(uint256 &batontxid, CTransaction bettx, uint256 bettxid)
{ {
int64_t addedbets = 0; int64_t addedbets = 0;
int32_t vini; int32_t vini;
@@ -490,12 +490,11 @@ int64_t prices_batontxid(uint256 &batontxid,CTransaction bettx,uint256 bettxid)
addedbets += amount; addedbets += amount;
std::cerr << "prices_batontxid() added amount=" << amount << std::endl; std::cerr << "prices_batontxid() added amount=" << amount << std::endl;
} }
else { else {
std::cerr << "prices_batontxid() cannot load or decode add bet tx, isLoaded=" << isLoaded << " funcId=" << (int)funcId << std::endl; std::cerr << "prices_batontxid() cannot load or decode add bet tx, isLoaded=" << isLoaded << " funcId=" << (int)funcId << std::endl;
} }
} }
return(addedbets); return(addedbets);
} }
@@ -548,7 +547,7 @@ UniValue PricesAddFunding(int64_t txfee, uint256 bettxid, int64_t amount)
mypk = pubkey2pk(Mypubkey()); mypk = pubkey2pk(Mypubkey());
pricespk = GetUnspendable(cp, 0); pricespk = GetUnspendable(cp, 0);
GetCCaddress(cp, myaddr, mypk); GetCCaddress(cp, myaddr, mypk);
if (AddNormalinputs(mtx, mypk, amount + txfee, 64) >= amount + txfee) if (AddNormalinputs(mtx, mypk, amount + 2*txfee, 64) >= amount + 2*txfee)
{ {
if (prices_batontxid(batontxid, bettx, bettxid) >= 0) if (prices_batontxid(batontxid, bettx, bettxid) >= 0)
{ {