Skip to content

Commit f3854c7

Browse files
committed
staticaddr: add nil checks for withdrawals
1 parent 1f8f282 commit f3854c7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

staticaddr/withdraw/manager.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,14 @@ func (m *Manager) WithdrawDeposits(ctx context.Context,
330330
return "", "", ErrWithdrawingMixedDeposits
331331
}
332332

333+
// Ensure that all previously withdrawn deposits reference their
334+
// finalized withdrawal tx.
335+
for _, d := range deposits {
336+
if d.FinalizedWithdrawalTx == nil {
337+
return "", "", ErrMissingPreviousWithdrawn
338+
}
339+
}
340+
333341
// If republishing of an existing withdrawal is requested we
334342
// ensure that all deposits remain clustered in the context of
335343
// the same withdrawal tx. We do this by checking that they have

0 commit comments

Comments
 (0)