chanbackup: support backup restore of script enforced leased channels

This commit is contained in:
Wilmer Paulino
2021-07-26 13:03:00 -07:00
committed by Olaoluwa Osuntokun
parent 974fc346cf
commit 0b0dd65c93
3 changed files with 58 additions and 6 deletions

View File

@@ -149,6 +149,12 @@ func (c *chanDBRestorer) openChannelShell(backup chanbackup.Single) (
chanType |= channeldb.AnchorOutputsBit
chanType |= channeldb.SingleFunderTweaklessBit
case chanbackup.ScriptEnforcedLeaseVersion:
chanType = channeldb.LeaseExpirationBit
chanType |= channeldb.ZeroHtlcTxFeeBit
chanType |= channeldb.AnchorOutputsBit
chanType |= channeldb.SingleFunderTweaklessBit
default:
return nil, fmt.Errorf("unknown Single version: %v", err)
}
@@ -172,6 +178,7 @@ func (c *chanDBRestorer) openChannelShell(backup chanbackup.Single) (
RemoteCurrentRevocation: backup.RemoteNodePub,
RevocationStore: shachain.NewRevocationStore(),
RevocationProducer: shaChainProducer,
ThawHeight: backup.LeaseExpiry,
},
}