Support forfeit with CHECKLOCKTIMEVERIFY (#389)

* explicit Timelock struct

* support & test CLTV forfeit path

* fix wasm pkg

* fix wasm

* fix liquid GetCurrentBlockTime

* cleaning

* move esplora URL check
This commit is contained in:
Louis Singer
2024-11-28 14:51:06 +01:00
committed by GitHub
parent a4ae439341
commit 02542c3634
51 changed files with 1007 additions and 257 deletions

View File

@@ -7,6 +7,7 @@ import (
"sync"
"time"
"github.com/ark-network/ark/common"
"github.com/ark-network/ark/common/note"
"github.com/ark-network/ark/common/tree"
"github.com/ark-network/ark/server/internal/core/domain"
@@ -357,12 +358,12 @@ func findSweepableOutputs(
}
}
var lifetime int64
var lifetime *common.Locktime
lifetime, sweepInput, err = txbuilder.GetSweepInput(node)
if err != nil {
return nil, err
}
expirationTime = blocktimeCache[node.ParentTxid] + lifetime
expirationTime = blocktimeCache[node.ParentTxid] + int64(lifetime.Value)
} else {
// cache the blocktime for future use
if schedulerUnit == ports.BlockHeight {