htlcswitch/hop: move NetworkHop to hop.Network

This commit is contained in:
Conner Fromknecht
2019-08-30 14:05:53 -07:00
parent 866867a4b0
commit 83d2112e8b
5 changed files with 37 additions and 33 deletions

28
htlcswitch/hop/network.go Normal file
View File

@@ -0,0 +1,28 @@
package hop
// Network indicates the blockchain network that is intended to be the next hop
// for a forwarded HTLC. The existence of this field within the ForwardingInfo
// struct enables the ability for HTLC to cross chain-boundaries at will.
type Network uint8
const (
// BitcoinNetwork denotes that an HTLC is to be forwarded along the
// Bitcoin link with the specified short channel ID.
BitcoinNetwork Network = iota
// LitecoinNetwork denotes that an HTLC is to be forwarded along the
// Litecoin link with the specified short channel ID.
LitecoinNetwork
)
// String returns the string representation of the target Network.
func (c Network) String() string {
switch c {
case BitcoinNetwork:
return "Bitcoin"
case LitecoinNetwork:
return "Litecoin"
default:
return "Kekcoin"
}
}