Refund even in failure
This commit is contained in:
parent
a1df44b3ee
commit
556b0dd572
|
@ -438,11 +438,9 @@ contract CoreRelayer is CoreRelayerGovernance {
|
|||
: (preGas - postGas);
|
||||
|
||||
// refund unused gas budget
|
||||
uint256 weiToRefund = internalInstruction.receiverValueTarget;
|
||||
if (success) {
|
||||
weiToRefund = (internalInstruction.executionParameters.gasLimit - gasUsed)
|
||||
* internalInstruction.maximumRefundTarget / internalInstruction.executionParameters.gasLimit;
|
||||
}
|
||||
uint256 weiToRefund = (internalInstruction.executionParameters.gasLimit - gasUsed)
|
||||
* internalInstruction.maximumRefundTarget / internalInstruction.executionParameters.gasLimit
|
||||
+ (success ? 0 : internalInstruction.receiverValueTarget);
|
||||
|
||||
// unlock the contract
|
||||
setContractLock(false);
|
||||
|
|
Loading…
Reference in New Issue