lnwallet+funding: expose new ValidateChannel method for 1st party validation
In this commit, we use the recently added `chanvalidate` package to verify channels once they have been confirmed in the funding manager. We expose a new method on the `LightningWallet` struct: `ValidateChannels` which calls the new shared 1st party verification code. After the channel is fully confirmed in the funding manager, we'll now use this newly exposed method to handle all validation. As a result, we can remove the existing validation code in the funding manager, and rely on the new code in isolation.
This commit is contained in:
3 files changed
+100
-32
No files matched your search
@@ -143,7 +143,7 @@ type Context struct {
|
||||
FundingTx *wire.MsgTx
|
||||
|
||||
// CommitCtx is an optional additional set of validation context
|
||||
// required to validate a self-owned channel. If present, then fully
|
||||
// required to validate a self-owned channel. If present, then a full
|
||||
// Script VM validation will be performed.
|
||||
CommitCtx *CommitmentContext
|
||||
}
|
||||
@@ -184,7 +184,7 @@ func Validate(ctx *Context) (*wire.OutPoint, error) {
|
||||
}
|
||||
|
||||
// If we reach this point, then all other checks have succeeded, so
|
||||
// we'll now attempt fully Script VM execution to ensure that we're
|
||||
// we'll now attempt a full Script VM execution to ensure that we're
|
||||
// able to close the channel using this initial state.
|
||||
vm, err := txscript.NewEngine(
|
||||
ctx.MultiSigPkScript, ctx.CommitCtx.FullySignedCommitTx,
|
||||
|
||||
Reference in new issue
Block a user