Merge pull request #3609 from bitromortac/fwdinghistory-msat-amounts
lnd+lnrpc: add msat forwarding amount fields to ForwardingHistory
This commit is contained in:
4 files changed
+581
-542
No files matched your search
+553
-533
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.
|
/// The total fee (in milli-satoshis) that this payment circuit carried.
|
||||||
uint64 fee_msat = 8 [json_name = "fee_msat"];
|
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?
|
// TODO(roasbeef): add settlement latency?
|
||||||
// * use FPE on the chan id?
|
// * use FPE on the chan id?
|
||||||
// * also list failures?
|
// * also list failures?
|
||||||
|
|||||||
@@ -2163,6 +2163,16 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uint64",
|
"format": "uint64",
|
||||||
"description": "/ The total fee (in milli-satoshis) that this payment circuit carried."
|
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+11
-9
@@ -4723,18 +4723,20 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
|
|||||||
LastOffsetIndex: timeSlice.LastIndexOffset,
|
LastOffsetIndex: timeSlice.LastIndexOffset,
|
||||||
}
|
}
|
||||||
for i, event := range timeSlice.ForwardingEvents {
|
for i, event := range timeSlice.ForwardingEvents {
|
||||||
amtInSat := event.AmtIn.ToSatoshis()
|
amtInMsat := event.AmtIn
|
||||||
amtOutSat := event.AmtOut.ToSatoshis()
|
amtOutMsat := event.AmtOut
|
||||||
feeMsat := event.AmtIn - event.AmtOut
|
feeMsat := event.AmtIn - event.AmtOut
|
||||||
|
|
||||||
resp.ForwardingEvents[i] = &lnrpc.ForwardingEvent{
|
resp.ForwardingEvents[i] = &lnrpc.ForwardingEvent{
|
||||||
Timestamp: uint64(event.Timestamp.Unix()),
|
Timestamp: uint64(event.Timestamp.Unix()),
|
||||||
ChanIdIn: event.IncomingChanID.ToUint64(),
|
ChanIdIn: event.IncomingChanID.ToUint64(),
|
||||||
ChanIdOut: event.OutgoingChanID.ToUint64(),
|
ChanIdOut: event.OutgoingChanID.ToUint64(),
|
||||||
AmtIn: uint64(amtInSat),
|
AmtIn: uint64(amtInMsat.ToSatoshis()),
|
||||||
AmtOut: uint64(amtOutSat),
|
AmtOut: uint64(amtOutMsat.ToSatoshis()),
|
||||||
Fee: uint64(feeMsat.ToSatoshis()),
|
Fee: uint64(feeMsat.ToSatoshis()),
|
||||||
FeeMsat: uint64(feeMsat),
|
FeeMsat: uint64(feeMsat),
|
||||||
|
AmtInMsat: uint64(amtInMsat),
|
||||||
|
AmtOutMsat: uint64(amtOutMsat),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user