lnrpc: add first hop custom records to RPC payment info
This commit is contained in:
5 files changed
+1275
-1229
No files matched your search
+1237
-1214
File diff suppressed because it is too large.
Load diff
@@ -4162,6 +4162,12 @@ message Payment {
|
|||||||
uint64 payment_index = 15;
|
uint64 payment_index = 15;
|
||||||
|
|
||||||
PaymentFailureReason failure_reason = 16;
|
PaymentFailureReason failure_reason = 16;
|
||||||
|
|
||||||
|
/*
|
||||||
|
The custom TLV records that were sent to the first hop as part of the HTLC
|
||||||
|
wire message for this payment.
|
||||||
|
*/
|
||||||
|
map<uint64, bytes> first_hop_custom_records = 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
message HTLCAttempt {
|
message HTLCAttempt {
|
||||||
|
|||||||
@@ -6417,6 +6417,14 @@
|
|||||||
},
|
},
|
||||||
"failure_reason": {
|
"failure_reason": {
|
||||||
"$ref": "#/definitions/lnrpcPaymentFailureReason"
|
"$ref": "#/definitions/lnrpcPaymentFailureReason"
|
||||||
|
},
|
||||||
|
"first_hop_custom_records": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "byte"
|
||||||
|
},
|
||||||
|
"description": "The custom TLV records that were sent to the first hop as part of the HTLC\nwire message for this payment."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1095,6 +1095,14 @@
|
|||||||
},
|
},
|
||||||
"failure_reason": {
|
"failure_reason": {
|
||||||
"$ref": "#/definitions/lnrpcPaymentFailureReason"
|
"$ref": "#/definitions/lnrpcPaymentFailureReason"
|
||||||
|
},
|
||||||
|
"first_hop_custom_records": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "byte"
|
||||||
|
},
|
||||||
|
"description": "The custom TLV records that were sent to the first hop as part of the HTLC\nwire message for this payment."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1682,21 +1682,22 @@ func (r *RouterBackend) MarshallPayment(payment *channeldb.MPPayment) (
|
|||||||
|
|
||||||
return &lnrpc.Payment{
|
return &lnrpc.Payment{
|
||||||
// TODO: set this to setID for AMP-payments?
|
// TODO: set this to setID for AMP-payments?
|
||||||
PaymentHash: hex.EncodeToString(paymentID[:]),
|
PaymentHash: hex.EncodeToString(paymentID[:]),
|
||||||
Value: satValue,
|
Value: satValue,
|
||||||
ValueMsat: msatValue,
|
ValueMsat: msatValue,
|
||||||
ValueSat: satValue,
|
ValueSat: satValue,
|
||||||
CreationDate: payment.Info.CreationTime.Unix(),
|
CreationDate: payment.Info.CreationTime.Unix(),
|
||||||
CreationTimeNs: creationTimeNS,
|
CreationTimeNs: creationTimeNS,
|
||||||
Fee: int64(fee.ToSatoshis()),
|
Fee: int64(fee.ToSatoshis()),
|
||||||
FeeSat: int64(fee.ToSatoshis()),
|
FeeSat: int64(fee.ToSatoshis()),
|
||||||
FeeMsat: int64(fee),
|
FeeMsat: int64(fee),
|
||||||
PaymentPreimage: hex.EncodeToString(preimage[:]),
|
PaymentPreimage: hex.EncodeToString(preimage[:]),
|
||||||
PaymentRequest: string(payment.Info.PaymentRequest),
|
PaymentRequest: string(payment.Info.PaymentRequest),
|
||||||
Status: status,
|
Status: status,
|
||||||
Htlcs: htlcs,
|
Htlcs: htlcs,
|
||||||
PaymentIndex: payment.SequenceNum,
|
PaymentIndex: payment.SequenceNum,
|
||||||
FailureReason: failureReason,
|
FailureReason: failureReason,
|
||||||
|
FirstHopCustomRecords: payment.Info.FirstHopCustomRecords,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user