mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 12:12:57 +02:00
switch+router+server: move NextPaymentID to router
This commit moves the responsibility of generating a unique payment ID from the switch to the router. This will make it easier for the router to keep track of which HTLCs were successfully forwarded onto the network, as it can query the switch for existing HTLCs as long as the paymentIDs are kept. The router is expected to maintain a map from paymentHash->paymentID, such that they can be replayed on restart. This also lets the router check the status of a sent payment after a restart, by querying the switch for the paymentID in question.
This commit is contained in:
@@ -14,6 +14,7 @@ type mockPaymentAttemptDispatcher struct {
|
||||
var _ PaymentAttemptDispatcher = (*mockPaymentAttemptDispatcher)(nil)
|
||||
|
||||
func (m *mockPaymentAttemptDispatcher) SendHTLC(firstHop lnwire.ShortChannelID,
|
||||
_ uint64,
|
||||
_ *lnwire.UpdateAddHTLC,
|
||||
_ htlcswitch.ErrorDecrypter) ([sha256.Size]byte, error) {
|
||||
|
||||
|
Reference in New Issue
Block a user