Check seized amount before performing operations
Ensure the seizaed bonds are sufficient before
enabling withdrawal abd pushing the
remainder to the keep group.
As a result, notifySignerSetupFailure relies less
on the implication that the bonds will be enough when called.
@@ -99,9 +99,11 @@ library DepositFunding {
// refund the deposit owner the cost to create a new Deposit at the time the Deposit was opened.
uint256 _seized = _d.seizeSignerBonds();
+ if(_seized >= _d.keepSetupFee){
/* solium-disable-next-line security/no-send */
_d.enableWithdrawal(_d.depositOwner(), _d.keepSetupFee);
_d.pushFundsToKeepGroup(_seized.sub(_d.keepSetupFee));
+ }
_d.setFailedSetup();
_d.logSetupFailed();
