1
0
Fork 0
forked from lthn/blockchain

fix for contract cancellation issue with zero b pledge or zero (a pledge + amount) 276

This commit is contained in:
sowle 2019-07-17 15:20:10 +03:00
parent 0b1c1de8a8
commit 6a575c6d29

View file

@ -3047,6 +3047,12 @@ void wallet2::build_escrow_cancel_template(crypto::hash multisig_id,
//generate cancel escrow proposal
construct_params.dsts[0].amount = ecrow_details.amount_a_pledge + ecrow_details.amount_to_pay;
construct_params.dsts[1].amount = ecrow_details.amount_b_pledge;
if (construct_params.dsts[0].amount == 0)
construct_params.dsts.erase(construct_params.dsts.begin());
else if (construct_params.dsts[1].amount == 0)
construct_params.dsts.erase(construct_params.dsts.begin() + 1);
tx_service_attachment tsa = AUTO_VAL_INIT(tsa);
tsa.service_id = BC_ESCROW_SERVICE_ID;
tsa.instruction = BC_ESCROW_SERVICE_INSTRUCTION_RELEASE_CANCEL;