Hello, I am a robot. #1

Closed
fyrchik wants to merge 70 commits from test-2144074865 into master
Showing only changes of commit 9a4f40626c - Show all commits

View file

@ -50,15 +50,18 @@ func (ap *Processor) processEmit() {
}
nmNodes := networkMap.Nodes()
nmLen := len(nmNodes)
extraLen := len(ap.parsedWallets)
ln := len(nmNodes)
if ln == 0 {
ap.log.Debug("empty network map, do not emit gas")
ap.log.Debug("gas emission",
zap.Int("network_map", nmLen),
zap.Int("extra_wallets", extraLen))
if nmLen+extraLen == 0 {
return
}
gasPerNode := fixedn.Fixed8(ap.storageEmission / uint64(ln+len(ap.parsedWallets)))
gasPerNode := fixedn.Fixed8(ap.storageEmission / uint64(nmLen+extraLen))
for i := range nmNodes {
keyBytes := nmNodes[i].PublicKey()
@ -81,9 +84,10 @@ func (ap *Processor) processEmit() {
}
}
if extraLen != 0 {
err = ap.morphClient.BatchTransferGas(ap.parsedWallets, gasPerNode)
if err != nil {
receiversLog := make([]string, len(ap.parsedWallets))
receiversLog := make([]string, extraLen)
for i, addr := range ap.parsedWallets {
receiversLog[i] = addr.StringLE()
}
@ -94,3 +98,4 @@ func (ap *Processor) processEmit() {
)
}
}
}