mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-09 18:52:09 +02:00
lnwire: add FirstBlock and BlockRange to GossipTimestampRange
Add new FirstBlockHeight and BlockRange TLV fields to the GossipTimestampRange message. This will be used to query for Gossip 1.75 messages which are timestamped using block height instead of Unix timestamps.
This commit is contained in:
@@ -1215,6 +1215,35 @@ func TestLightningWireProtocol(t *testing.T) {
|
||||
|
||||
v[0] = reflect.ValueOf(req)
|
||||
},
|
||||
MsgGossipTimestampRange: func(v []reflect.Value, r *rand.Rand) {
|
||||
req := GossipTimestampRange{
|
||||
FirstTimestamp: rand.Uint32(),
|
||||
TimestampRange: rand.Uint32(),
|
||||
ExtraData: make([]byte, 0),
|
||||
}
|
||||
|
||||
_, err := rand.Read(req.ChainHash[:])
|
||||
require.NoError(t, err)
|
||||
|
||||
// Sometimes add a block range.
|
||||
if r.Int31()%2 == 0 {
|
||||
firstBlock := tlv.ZeroRecordT[
|
||||
tlv.TlvType2, uint32,
|
||||
]()
|
||||
firstBlock.Val = rand.Uint32()
|
||||
req.FirstBlockHeight = tlv.SomeRecordT(
|
||||
firstBlock,
|
||||
)
|
||||
|
||||
blockRange := tlv.ZeroRecordT[
|
||||
tlv.TlvType4, uint32,
|
||||
]()
|
||||
blockRange.Val = rand.Uint32()
|
||||
req.BlockRange = tlv.SomeRecordT(blockRange)
|
||||
}
|
||||
|
||||
v[0] = reflect.ValueOf(req)
|
||||
},
|
||||
MsgQueryShortChanIDs: func(v []reflect.Value, r *rand.Rand) {
|
||||
req := QueryShortChanIDs{
|
||||
ExtraData: make([]byte, 0),
|
||||
|
Reference in New Issue
Block a user