mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
Merge pull request #3609 from bitromortac/fwdinghistory-msat-amounts
lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory
This commit is contained in:
commit
21a40daf58
4 changed files with 581 additions and 542 deletions
1086
lnrpc/rpc.pb.go
1086
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load diff
|
@ -2498,6 +2498,13 @@ message ForwardingEvent {
|
|||
/// The total fee (in milli-satoshis) that this payment circuit carried.
|
||||
uint64 fee_msat = 8 [json_name = "fee_msat"];
|
||||
|
||||
/// The total amount (in milli-satoshis) of the incoming HTLC that created half the circuit.
|
||||
uint64 amt_in_msat = 9 [json_name = "amt_in_msat"];
|
||||
|
||||
/// The total amount (in milli-satoshis) of the outgoing HTLC that created the second half of the circuit.
|
||||
uint64 amt_out_msat = 10 [json_name = "amt_out_msat"];
|
||||
|
||||
|
||||
// TODO(roasbeef): add settlement latency?
|
||||
// * use FPE on the chan id?
|
||||
// * also list failures?
|
||||
|
|
|
@ -2163,6 +2163,16 @@
|
|||
"type": "string",
|
||||
"format": "uint64",
|
||||
"description": "/ The total fee (in milli-satoshis) that this payment circuit carried."
|
||||
},
|
||||
"amt_in_msat": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"description": "/ The total amount (in milli-satoshis) of the incoming HTLC that created half the circuit."
|
||||
},
|
||||
"amt_out_msat": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"description": "/ The total amount (in milli-satoshis) of the outgoing HTLC that created the second half of the circuit."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
20
rpcserver.go
20
rpcserver.go
|
@ -4723,18 +4723,20 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
|
|||
LastOffsetIndex: timeSlice.LastIndexOffset,
|
||||
}
|
||||
for i, event := range timeSlice.ForwardingEvents {
|
||||
amtInSat := event.AmtIn.ToSatoshis()
|
||||
amtOutSat := event.AmtOut.ToSatoshis()
|
||||
amtInMsat := event.AmtIn
|
||||
amtOutMsat := event.AmtOut
|
||||
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(amtInSat),
|
||||
AmtOut: uint64(amtOutSat),
|
||||
Fee: uint64(feeMsat.ToSatoshis()),
|
||||
FeeMsat: uint64(feeMsat),
|
||||
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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue