feat: Minimum block rewards to send notifications
Flexpool is now finding more blocks than ever. There are tons of notifications all day long. This commit adds a new pool setting `min-block-reward` to send notifications for blocks reaching this minimum threshold, so we can focus on big blocks. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
e3ae989511
commit
b519770922
6 changed files with 13 additions and 4 deletions
6
main.go
6
main.go
|
@ -263,7 +263,11 @@ func main() {
|
|||
log.Warnf("Cannot update pool: %v", trx.Error)
|
||||
continue
|
||||
}
|
||||
if notify {
|
||||
convertedReward, err := ConvertCurrency(pool.Coin, block.Reward)
|
||||
if err != nil {
|
||||
log.Warnf("Reward for block %d cannot be converted: %v", block.Number, err)
|
||||
}
|
||||
if notify && convertedReward >= configuredPool.MinBlockReward {
|
||||
err = notifier.NotifyBlock(*pool, *block)
|
||||
if err != nil {
|
||||
log.Warnf("Cannot send notification: %v", err)
|
||||
|
|
Reference in a new issue