loop: correct htlc script version for very old swaps

This commit is contained in:
Andras Banki-Horvath 2023-04-20 08:12:09 +02:00
parent 257b5f212d
commit a8dd2dca07
No known key found for this signature in database
GPG key ID: 80E5375C094198D8

View file

@ -56,7 +56,9 @@ func GetHtlcScriptVersion(
protocolVersion loopdb.ProtocolVersion) swap.ScriptVersion {
// If the swap was initiated before we had our v3 script, use v2.
if protocolVersion < loopdb.ProtocolVersionHtlcV3 {
if protocolVersion < loopdb.ProtocolVersionHtlcV3 ||
protocolVersion == loopdb.ProtocolVersionUnrecorded {
return swap.HtlcV2
}