Skip to content

Commit

Permalink
Merge pull request #276 from syscoin/dev-3.x
Browse files Browse the repository at this point in the history
Dev 3.x

Former-commit-id: 21f8534
  • Loading branch information
sidhujag committed Sep 5, 2018
2 parents 6c02d1d + 7762146 commit f15f40a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/assetallocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ bool CheckAssetAllocationInputs(const CTransaction &tx, const CCoinsViewCache &i
}
}
const CAmount &nBalanceAfterSend = dbAssetAllocation.nBalance - nTotal;
if (nBalanceAfterSend < 0) {
if (nBalanceAfterSend < -1000) {
bBalanceOverrun = true;
if(bSanityCheck)
errorMessage = "SYSCOIN_ASSET_ALLOCATION_CONSENSUS_ERROR: ERRCODE: 1021 - " + _("Sender balance is insufficient");
Expand Down Expand Up @@ -607,6 +607,8 @@ bool CheckAssetAllocationInputs(const CTransaction &tx, const CCoinsViewCache &i
receiverAllocation.vchMemo = theAssetAllocation.vchMemo;
receiverAllocation.nBalance += amountTuple.second;
theAssetAllocation.nBalance -= amountTuple.second;
if (theAssetAllocation.nBalance < 0)
theAssetAllocation.nBalance = 0;

}
const string& receiverAddress = stringFromVch(receiverAllocation.vchAliasOrAddress);
Expand Down

0 comments on commit f15f40a

Please sign in to comment.