Skip to content

Commit

Permalink
Merge pull request bitcoin#221 from faizkhan00/0.0.9-cancelprice-fix
Browse files Browse the repository at this point in the history
Add cancel-at-price to exclusions for funds checks in send_INTERNAL_1pac...
  • Loading branch information
m21 committed Dec 1, 2014
2 parents 4c3f204 + 8f2cd4b commit ad23a73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/mastercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2904,15 +2904,15 @@ const unsigned int prop = PropertyID;
return 0;
}

bool bCancel_AllOrPair = false;
//If doing a METADEX CANCEL 3 or 4, use following flag to bypass funds checks
if((TransactionType == MSC_TYPE_METADEX) && ((additional == CMPTransaction::CANCEL_ALL_FOR_PAIR) || (additional == CMPTransaction::CANCEL_EVERYTHING)))
bool bCancel_checkBypass = false;
//If doing a METADEX CANCEL, use following flag to bypass funds checks
if((TransactionType == MSC_TYPE_METADEX) && ((additional == CMPTransaction::CANCEL_AT_PRICE) || (additional == CMPTransaction::CANCEL_ALL_FOR_PAIR) || (additional == CMPTransaction::CANCEL_EVERYTHING)))
{
bCancel_AllOrPair = true;
bCancel_checkBypass = true;
}

// make sure this address has enough MP property available!
if ((((uint64_t)iAvailable < Amount) || (0 == Amount)) && !bCancel_AllOrPair)
if ((((uint64_t)iAvailable < Amount) || (0 == Amount)) && !bCancel_checkBypass)
{
LogPrintf("%s(): aborted -- not enough MP property (%lu < %lu)\n", __FUNCTION__, iAvailable, Amount);
if (msc_debug_send) file_log("%s(): aborted -- not enough MP property (%lu < %lu)\n", __FUNCTION__, iAvailable, Amount);
Expand All @@ -2924,7 +2924,7 @@ const unsigned int prop = PropertyID;

// check once more, this time considering PENDING amount reduction
// make sure this address has enough MP property available!
if (((iUserAvailable < (int64_t)Amount) || (0 == Amount)) && !bCancel_AllOrPair)
if (((iUserAvailable < (int64_t)Amount) || (0 == Amount)) && !bCancel_checkBypass)
{
LogPrintf("%s(): aborted -- not enough MP property with PENDING reduction (%lu < %lu)\n", __FUNCTION__, iUserAvailable, Amount);
if (msc_debug_send) file_log("%s(): aborted -- not enough MP property with PENDING reduction (%lu < %lu)\n", __FUNCTION__, iUserAvailable, Amount);
Expand Down

0 comments on commit ad23a73

Please sign in to comment.