mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 22:02:29 +02:00
routing: use Identifier in place of PaymentHash
Since we want to support AMP payment using a different unique payment identifier (AMP payments don't go to one specific hash), we change the nomenclature to be Identifier instead of PaymentHash.
This commit is contained in:
@@ -173,8 +173,10 @@ func (p *PaymentControl) InitPayment(paymentHash lntypes.Hash,
|
||||
|
||||
// Once we have obtained a sequence number, we add an entry
|
||||
// to our index bucket which will map the sequence number to
|
||||
// our payment hash.
|
||||
err = createPaymentIndexEntry(tx, sequenceNum, info.PaymentHash)
|
||||
// our payment identifier.
|
||||
err = createPaymentIndexEntry(
|
||||
tx, sequenceNum, info.PaymentIdentifier,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -220,12 +222,12 @@ const paymentIndexTypeHash paymentIndexType = 0
|
||||
|
||||
// createPaymentIndexEntry creates a payment hash typed index for a payment. The
|
||||
// index produced contains a payment index type (which can be used in future to
|
||||
// signal different payment index types) and the payment hash.
|
||||
// signal different payment index types) and the payment identifier.
|
||||
func createPaymentIndexEntry(tx kvdb.RwTx, sequenceNumber []byte,
|
||||
hash lntypes.Hash) error {
|
||||
id lntypes.Hash) error {
|
||||
|
||||
var b bytes.Buffer
|
||||
if err := WriteElements(&b, paymentIndexTypeHash, hash[:]); err != nil {
|
||||
if err := WriteElements(&b, paymentIndexTypeHash, id[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user