lnrpc: add timestamp_ns field to ForwardingEvent msg
This allows to use FowardingHistory rpc method to receive the data exactly as it's stored in lnd and to synchronize incrementally the history to an external database.
This commit is contained in:
1 parent
3c14e3d71d
commit
4bab68a808
4 files changed
+817
-795
No files matched your search
+10
-9
@@ -6139,15 +6139,16 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
|
||||
feeMsat := event.AmtIn - event.AmtOut
|
||||
|
||||
resp.ForwardingEvents[i] = &lnrpc.ForwardingEvent{
|
||||
Timestamp: uint64(event.Timestamp.Unix()),
|
||||
ChanIdIn: event.IncomingChanID.ToUint64(),
|
||||
ChanIdOut: event.OutgoingChanID.ToUint64(),
|
||||
AmtIn: uint64(amtInMsat.ToSatoshis()),
|
||||
AmtOut: uint64(amtOutMsat.ToSatoshis()),
|
||||
Fee: uint64(feeMsat.ToSatoshis()),
|
||||
FeeMsat: uint64(feeMsat),
|
||||
AmtInMsat: uint64(amtInMsat),
|
||||
AmtOutMsat: uint64(amtOutMsat),
|
||||
Timestamp: uint64(event.Timestamp.Unix()),
|
||||
TimestampNs: uint64(event.Timestamp.UnixNano()),
|
||||
ChanIdIn: event.IncomingChanID.ToUint64(),
|
||||
ChanIdOut: event.OutgoingChanID.ToUint64(),
|
||||
AmtIn: uint64(amtInMsat.ToSatoshis()),
|
||||
AmtOut: uint64(amtOutMsat.ToSatoshis()),
|
||||
Fee: uint64(feeMsat.ToSatoshis()),
|
||||
FeeMsat: uint64(feeMsat),
|
||||
AmtInMsat: uint64(amtInMsat),
|
||||
AmtOutMsat: uint64(amtOutMsat),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user