watchtower: Add retry logic for fetching blocks

By default, try to fetch the blocks 3 more times
in case of error.
This commit is contained in:
Animesh Bilthare committed 2024-10-26 16:59:13 +05:30
1 parent acbb33bb7b
commit ecd4480331
4 files changed
+79 -5

No files matched your search

+4
View File
@@ -3,6 +3,7 @@ package watchtower
import (
"net"
"sync/atomic"
"time"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/lightningnetwork/lnd/brontide"
@@ -65,6 +66,9 @@ func New(cfg *Config) (*Standalone, error) {
DB: cfg.DB,
EpochRegistrar: cfg.EpochRegistrar,
Punisher: punisher,
MinBackoff: time.Second,
MaxBackoff: time.Minute,
MaxNumRetries: 5,
})
// Create a brontide listener on each of the provided listening