sweep+input: add RequiredLockTime to inputs

This commit is contained in:
Johan T. Halseth
2020-11-06 19:35:01 +01:00
parent fa4fd02cf1
commit efd6bc9501
5 changed files with 251 additions and 17 deletions

View File

@@ -15,6 +15,10 @@ type Input interface {
// construct the corresponding transaction input.
OutPoint() *wire.OutPoint
// RequiredLockTime returns whether this input commits to a tx locktime
// that must be used in the transaction including it.
RequiredLockTime() (uint32, bool)
// WitnessType returns an enum specifying the type of witness that must
// be generated in order to spend this output.
WitnessType() WitnessType
@@ -75,6 +79,13 @@ func (i *inputKit) OutPoint() *wire.OutPoint {
return &i.outpoint
}
// RequiredLockTime returns whether this input commits to a tx locktime that
// must be used in the transaction including it. This will be false for the
// base input type since we can re-sign for any lock time.
func (i *inputKit) RequiredLockTime() (uint32, bool) {
return 0, false
}
// WitnessType returns the type of witness that must be generated to spend the
// breached output.
func (i *inputKit) WitnessType() WitnessType {