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

+2 -1
View File
@@ -10,6 +10,7 @@ import (
"github.com/btcsuite/btcd/wire"
"github.com/coreos/bbolt"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
)
@@ -105,7 +106,7 @@ type ContractTerm struct {
// PaymentPreimage is the preimage which is to be revealed in the
// occasion that an HTLC paying to the hash of this preimage is
// extended.
PaymentPreimage [32]byte
PaymentPreimage lntypes.Preimage
// Value is the expected amount of milli-satoshis to be paid to an HTLC
// which can be satisfied by the above preimage.