mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 06:32:18 +02:00
multi: make ProofMatureDelta
configurable
We add a new config option to set the `ProofMatureDelta` so the users can tune their graphs based on their own preference over the num of confs found in the announcement signatures.
This commit is contained in:
@@ -62,6 +62,11 @@ const (
|
||||
// we'll maintain. This is the global size across all peers. We'll
|
||||
// allocate ~3 MB max to the cache.
|
||||
maxRejectedUpdates = 10_000
|
||||
|
||||
// DefaultProofMatureDelta specifies the default value used for
|
||||
// ProofMatureDelta, which is the number of confirmations needed before
|
||||
// processing the announcement signatures.
|
||||
DefaultProofMatureDelta = 6
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -1984,8 +1989,14 @@ func (d *AuthenticatedGossiper) addNode(msg *lnwire.NodeAnnouncement,
|
||||
// NOTE: must be used inside a lock.
|
||||
func (d *AuthenticatedGossiper) isPremature(chanID lnwire.ShortChannelID,
|
||||
delta uint32, msg *networkMsg) bool {
|
||||
// TODO(roasbeef) make height delta 6
|
||||
// * or configurable
|
||||
|
||||
// The channel is already confirmed at chanID.BlockHeight so we minus
|
||||
// one block. For instance, if the required confirmation for this
|
||||
// channel announcement is 6, we then only need to wait for 5 more
|
||||
// blocks once the funding tx is confirmed.
|
||||
if delta > 0 {
|
||||
delta--
|
||||
}
|
||||
|
||||
msgHeight := chanID.BlockHeight + delta
|
||||
|
||||
|
Reference in New Issue
Block a user