diff --git a/pkg/innerring/processors/settlement/basic/collect.go b/pkg/innerring/processors/settlement/basic/collect.go index e9dc61ac..f7844674 100644 --- a/pkg/innerring/processors/settlement/basic/collect.go +++ b/pkg/innerring/processors/settlement/basic/collect.go @@ -34,6 +34,8 @@ func (inc *IncomeSettlementContext) Collect() { return } + txTable := common.NewTransferTable() + for i := range cnrEstimations { owner, err := inc.container.ContainerInfo(cnrEstimations[i].ContainerID) if err != nil { @@ -61,14 +63,14 @@ func (inc *IncomeSettlementContext) Collect() { inc.distributeTable.Put(cnrNodes[i].PublicKey(), avg) } - inc.txTable.Transfer(&common.TransferTx{ + txTable.Transfer(&common.TransferTx{ From: owner.Owner(), To: inc.bankOwner, Amount: total, }) } - common.TransferAssets(inc.exchange, inc.txTable) + common.TransferAssets(inc.exchange, txTable) } // avgEstimation returns estimation value for single container. Right now it diff --git a/pkg/innerring/processors/settlement/basic/context.go b/pkg/innerring/processors/settlement/basic/context.go index 599effb1..23e5fa3d 100644 --- a/pkg/innerring/processors/settlement/basic/context.go +++ b/pkg/innerring/processors/settlement/basic/context.go @@ -41,7 +41,6 @@ type ( exchange common.Exchanger accounts common.AccountStorage - txTable *common.TransferTable bankOwner *owner.ID // this table is not thread safe, make sure you use it with mu.Lock() @@ -77,7 +76,6 @@ func NewIncomeSettlementContext(p *IncomeSettlementContextPrms) (*IncomeSettleme placement: p.Placement, exchange: p.Exchange, accounts: p.Accounts, - txTable: common.NewTransferTable(), bankOwner: bankingAccount, distributeTable: NewNodeSizeTable(), }, nil