multi: add relative thaw height interpretation

This is useful when we wish to have a channel frozen for a specific
amount of blocks after its confirmation. This could also be done with an
absolute thaw height, but it does not suit cases where a strict block
delta needs to be enforced, as it's not possible to know for certain
when a channel will be included in the chain. To work around this, we
add a relative interpretation of the field, where if its value is below
500,000, then it's interpreted as a relative height. This approach
allows us to prevent further database modifications to account for a
relative thaw height.
This commit is contained in:
Wilmer Paulino committed 2020-07-02 12:05:49 -07:00
1 parent 01ba4d0b59
commit 6075997ebc
7 files changed
+80 -38

No files matched your search

+1 -6
View File
@@ -14501,11 +14501,6 @@ func testExternalFundingChanPoint(net *lntest.NetworkHarness, t *harnessTest) {
t.Fatalf("unable to gen pending chan ID: %v", err)
}
_, currentHeight, err := net.Miner.Node.GetBestBlock()
if err != nil {
t.Fatalf("unable to get current blockheight %v", err)
}
// Now that we have the pending channel ID, Dave (our responder) will
// register the intent to receive a new channel funding workflow using
// the pending channel ID.
@@ -14514,7 +14509,7 @@ func testExternalFundingChanPoint(net *lntest.NetworkHarness, t *harnessTest) {
FundingTxidBytes: txid[:],
},
}
thawHeight := uint32(currentHeight + 10)
thawHeight := uint32(10)
chanPointShim := &lnrpc.ChanPointShim{
Amt: int64(chanSize),
ChanPoint: chanPoint,