invoices: use lntypes.Hash and lntypes.Preimage

Previously chainhash.Hash was used, which converts to/from string in
reversed format. Payment hashes and preimages are supposed to be
non-reversed.
This commit is contained in:
Joost Jager committed 2019-02-01 09:42:29 +01:00
1 parent 18698663c5
commit bacd92418a
9 files changed
+35 -30

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
package htlcswitch
import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
)
@@ -14,11 +14,11 @@ type InvoiceDatabase interface {
// byte payment hash. This method should also reutrn the min final CLTV
// delta for this invoice. We'll use this to ensure that the HTLC
// extended to us gives us enough time to settle as we prescribe.
LookupInvoice(chainhash.Hash) (channeldb.Invoice, uint32, error)
LookupInvoice(lntypes.Hash) (channeldb.Invoice, uint32, error)
// SettleInvoice attempts to mark an invoice corresponding to the
// passed payment hash as fully settled.
SettleInvoice(payHash chainhash.Hash, paidAmount lnwire.MilliSatoshi) error
SettleInvoice(payHash lntypes.Hash, paidAmount lnwire.MilliSatoshi) error
}
// ChannelLink is an interface which represents the subsystem for managing the