From 06b360325a2fda0bce7376e72dd9c6c1a9835ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 8 Mar 2021 22:09:04 +0100 Subject: [PATCH] handle terminate control addrs in address selection correctly --- storage/addresses.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/storage/addresses.go b/storage/addresses.go index ff8fcbd99..a8e5e7101 100644 --- a/storage/addresses.go +++ b/storage/addresses.go @@ -40,7 +40,11 @@ func (as *AddressSelector) AddressFor(ctx context.Context, a addrSelectApi, mi m delete(defaultCtl, mi.Owner) delete(defaultCtl, mi.Worker) - for _, addr := range append(append([]address.Address{}, as.PreCommitControl...), as.CommitControl...) { + configCtl := append([]address.Address{}, as.PreCommitControl...) + configCtl = append(configCtl, as.CommitControl...) + configCtl = append(configCtl, as.TerminateControl...) + + for _, addr := range configCtl { if addr.Protocol() != address.ID { var err error addr, err = a.StateLookupID(ctx, addr, types.EmptyTSK) @@ -97,7 +101,7 @@ func pickAddress(ctx context.Context, a addrSelectApi, mi miner.MinerInfo, goodF } } - log.Warnw("No address had enough funds to for full PoSt message Fee, selecting least bad address", "address", leastBad, "balance", types.FIL(bestAvail), "optimalFunds", types.FIL(goodFunds), "minFunds", types.FIL(minFunds)) + log.Warnw("No address had enough funds to for full message Fee, selecting least bad address", "address", leastBad, "balance", types.FIL(bestAvail), "optimalFunds", types.FIL(goodFunds), "minFunds", types.FIL(minFunds)) return leastBad, bestAvail, nil }