mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
htlc: add string representation for HtlcOutputType enum
This commit is contained in:
parent
87cc5571ef
commit
60661504a5
1 changed files with 14 additions and 0 deletions
14
swap/htlc.go
14
swap/htlc.go
|
|
@ -50,6 +50,20 @@ var (
|
|||
)
|
||||
)
|
||||
|
||||
// String returns the string value of HtlcOutputType.
|
||||
func (h HtlcOutputType) String() string {
|
||||
switch h {
|
||||
case HtlcP2WSH:
|
||||
return "P2WSH"
|
||||
|
||||
case HtlcNP2WSH:
|
||||
return "NP2WSH"
|
||||
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// NewHtlc returns a new instance.
|
||||
func NewHtlc(cltvExpiry int32, senderKey, receiverKey [33]byte,
|
||||
hash lntypes.Hash, outputType HtlcOutputType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue