mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
multi: add ProtocolVersion_HTLC_V3
This commit is contained in:
parent
7cc6ef2ffd
commit
9b37d744a0
7 changed files with 177 additions and 153 deletions
|
|
@ -51,13 +51,17 @@ const (
|
|||
// in order to enhance off-chain payments corresponding to a swap.
|
||||
ProtocolVersionRoutingPlugin = 9
|
||||
|
||||
// ProtocolVersionHtlcV3 indicates that the client will now use the new
|
||||
// HTLC v3 (P2TR) script for swaps.
|
||||
ProtocolVersionHtlcV3 = 10
|
||||
|
||||
// ProtocolVersionUnrecorded is set for swaps were created before we
|
||||
// started saving protocol version with swaps.
|
||||
ProtocolVersionUnrecorded ProtocolVersion = math.MaxUint32
|
||||
|
||||
// CurrentRPCProtocolVersion defines the version of the RPC protocol
|
||||
// that is currently supported by the loop client.
|
||||
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_ROUTING_PLUGIN
|
||||
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_HTLC_V3
|
||||
|
||||
// CurrentInternalProtocolVersion defines the RPC current protocol in
|
||||
// the internal representation.
|
||||
|
|
@ -102,6 +106,9 @@ func (p ProtocolVersion) String() string {
|
|||
case ProtocolVersionRoutingPlugin:
|
||||
return "Routing Plugin"
|
||||
|
||||
case ProtocolVersionHtlcV3:
|
||||
return "HTLC V3"
|
||||
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ func TestProtocolVersionSanity(t *testing.T) {
|
|||
ProtocolVersionLoopOutCancel,
|
||||
ProtocolVersionProbe,
|
||||
ProtocolVersionRoutingPlugin,
|
||||
ProtocolVersionHtlcV3,
|
||||
}
|
||||
|
||||
rpcVersions := [...]looprpc.ProtocolVersion{
|
||||
|
|
@ -37,6 +38,7 @@ func TestProtocolVersionSanity(t *testing.T) {
|
|||
looprpc.ProtocolVersion_LOOP_OUT_CANCEL,
|
||||
looprpc.ProtocolVersion_PROBE,
|
||||
looprpc.ProtocolVersion_ROUTING_PLUGIN,
|
||||
looprpc.ProtocolVersion_HTLC_V3,
|
||||
}
|
||||
|
||||
require.Equal(t, len(versions), len(rpcVersions))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue