@@ -628,12 +628,12 @@ func (pool *WalletPool) prepareWallet(privkey string, client *Client, refillAmou
628628 }
629629
630630 // Set up low balance notification
631- if pool .runFundings {
631+ if pool .runFundings && refillBalance != nil {
632632 childWallet .setLowBalanceNotification (pool .lowBalanceNotifyChan , refillBalance .ToBig ())
633633 }
634634
635635 var fundingReq * FundingRequest
636- if pool .runFundings && childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) < 0 {
636+ if pool .runFundings && refillBalance != nil && childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) < 0 {
637637 currentBalance := uint256 .MustFromBig (childWallet .GetBalance ())
638638 fundingReq = & FundingRequest {
639639 Wallet : childWallet ,
@@ -777,7 +777,7 @@ func (pool *WalletPool) resupplyChildWallets() error {
777777 return
778778 }
779779
780- if childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) < 0 {
780+ if refillBalance != nil && childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) < 0 {
781781 currentBalance := uint256 .MustFromBig (childWallet .GetBalance ())
782782 reqsMutex .Lock ()
783783 fundingReqs = append (fundingReqs , & FundingRequest {
@@ -807,7 +807,7 @@ func (pool *WalletPool) resupplyChildWallets() error {
807807 walletErr = err
808808 return
809809 }
810- if childWallet .GetBalance ().Cmp (pool .config .RefillBalance .ToBig ()) < 0 {
810+ if pool . config . RefillBalance != nil && childWallet .GetBalance ().Cmp (pool .config .RefillBalance .ToBig ()) < 0 {
811811 currentBalance := uint256 .MustFromBig (childWallet .GetBalance ())
812812 reqsMutex .Lock ()
813813 fundingReqs = append (fundingReqs , & FundingRequest {
@@ -1128,7 +1128,7 @@ func (pool *WalletPool) CheckChildWalletBalance(childWallet *Wallet) error {
11281128 }
11291129 }
11301130
1131- if childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) >= 0 {
1131+ if refillBalance == nil || childWallet .GetBalance ().Cmp (refillBalance .ToBig ()) >= 0 {
11321132 return nil
11331133 }
11341134
0 commit comments