multi: Add itest for funding timeout

This commit adds an integration test that
verifies the funding timeout behavior in the
funding manager, in dev/integration test.
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
This commit is contained in:
Nishant Bansal
2025-03-07 21:32:38 +05:30
parent a5f54d1d6b
commit 4569c07e08
9 changed files with 132 additions and 22 deletions

View File

@@ -3850,9 +3850,21 @@ func (r *rpcServer) fetchPendingOpenChannels() (pendingOpenChannels, error) {
commitBaseWeight := blockchain.GetTransactionWeight(utx)
commitWeight := commitBaseWeight + witnessWeight
// The value of waitBlocksForFundingConf is adjusted in a
// development environment to enhance test capabilities.
// Otherwise, it is set to DefaultMaxWaitNumBlocksFundingConf.
waitBlocksForFundingConf := uint32(
lncfg.DefaultMaxWaitNumBlocksFundingConf,
)
if lncfg.IsDevBuild() {
waitBlocksForFundingConf =
r.cfg.Dev.GetMaxWaitNumBlocksFundingConf()
}
// FundingExpiryBlocks is the distance from the current block
// height to the broadcast height + MaxWaitNumBlocksFundingConf.
maxFundingHeight := funding.MaxWaitNumBlocksFundingConf +
// height to the broadcast height + waitBlocksForFundingConf.
maxFundingHeight := waitBlocksForFundingConf +
pendingChan.BroadcastHeight()
fundingExpiryBlocks := int32(maxFundingHeight) - currentHeight