We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 523ecc0 commit fc5f8e3Copy full SHA for fc5f8e3
channeldb/peers.go
@@ -50,6 +50,12 @@ type FlapCount struct {
50
// bucket for the peer's pubkey if necessary. Note that this function overwrites
51
// the current value.
52
func (d *DB) WriteFlapCounts(flapCounts map[route.Vertex]*FlapCount) error {
53
+ // Exit early if there are no updates.
54
+ if len(flapCounts) == 0 {
55
+ log.Debugf("No flap counts to write, skipped db update")
56
+ return nil
57
+ }
58
+
59
return kvdb.Update(d, func(tx kvdb.RwTx) error {
60
// Run through our set of flap counts and record them for
61
// each peer, creating a bucket for the peer pubkey if required.
0 commit comments