lntypes: add ZeroHash
This commit is contained in:
parent
970d760407
commit
afd86763ac
@ -8,6 +8,9 @@ import (
|
|||||||
// HashSize of array used to store hashes.
|
// HashSize of array used to store hashes.
|
||||||
const HashSize = 32
|
const HashSize = 32
|
||||||
|
|
||||||
|
// ZeroHash is a predefined hash containing all zeroes.
|
||||||
|
var ZeroHash Hash
|
||||||
|
|
||||||
// Hash is used in several of the lightning messages and common structures. It
|
// Hash is used in several of the lightning messages and common structures. It
|
||||||
// typically represents a payment hash.
|
// typically represents a payment hash.
|
||||||
type Hash [HashSize]byte
|
type Hash [HashSize]byte
|
||||||
|
@ -67,8 +67,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
zeroHash [32]byte
|
|
||||||
|
|
||||||
// MaxPaymentMSat is the maximum allowed payment currently permitted as
|
// MaxPaymentMSat is the maximum allowed payment currently permitted as
|
||||||
// defined in BOLT-002. This value depends on which chain is active.
|
// defined in BOLT-002. This value depends on which chain is active.
|
||||||
// It is set to the value under the Bitcoin chain as default.
|
// It is set to the value under the Bitcoin chain as default.
|
||||||
@ -3018,7 +3016,9 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error
|
|||||||
// If we're in debug HTLC mode, then all outgoing HTLCs will pay to the
|
// If we're in debug HTLC mode, then all outgoing HTLCs will pay to the
|
||||||
// same debug rHash. Otherwise, we pay to the rHash specified within
|
// same debug rHash. Otherwise, we pay to the rHash specified within
|
||||||
// the RPC request.
|
// the RPC request.
|
||||||
case cfg.DebugHTLC && bytes.Equal(payIntent.rHash[:], zeroHash[:]):
|
case cfg.DebugHTLC &&
|
||||||
|
bytes.Equal(payIntent.rHash[:], lntypes.ZeroHash[:]):
|
||||||
|
|
||||||
copy(payIntent.rHash[:], invoices.DebugHash[:])
|
copy(payIntent.rHash[:], invoices.DebugHash[:])
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user