Clarification regarding the timestamp field
Opened this issue · 3 comments
What exactly does the timestamp field denote in the restore function?
Does it mean that the channels returned in the O/P are open at that timestamp and the listed nodes are reachable as well?
Additionally, if my goal is to get the topology from the latest dataset would the epoch value corresponding to the date on the name of the dataset suffice?
The timestamps are selected by the node at the time they decide to send a node or channel update. They are supposed to be close to the actual current time, since there are some age thresholds in the specification. We do not have control over them since they're part of the signed payload.
In order to reconstruct the topology at a given time you'll have to replay the gossip messages whose timestamp is lower than your snapshot time (in order) and then prune all channels whose funding outpoint was spent (we currently don't track channel closes).
Thanks for the clarification. So basically, if I want a network snapshot I just take the timestamp value of the date I want the snapshot for and I direct the O/P to a file? I tried this for the timestamp corresponding to 01/01/2020 and got the error that all the nodes are pruned. Any idea as to why I got that error? I ran it over various other timestamps and it seems to work fine.
prune all channels whose funding outpoint was spent
how can I do that without searching the whole blockchain from when the channel was opened? With gettxout I can only check if the output is currently unspent but not if it was unspent at a certain time in the past.