mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-20 13:27:31 +02:00
blockchain: use taproot script flags for validation after activation
This commit is contained in:
parent
ba9fb8ece1
commit
23cf18b050
1 changed files with 13 additions and 1 deletions
|
|
@ -11,11 +11,11 @@ import (
|
|||
"math/big"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -1218,6 +1218,18 @@ func (b *BlockChain) checkConnectBlock(node *blockNode, block *btcutil.Block, vi
|
|||
scriptFlags |= txscript.ScriptStrictMultiSig
|
||||
}
|
||||
|
||||
// Before we execute the main scripts, we'll also check to see if
|
||||
// taproot is active or not.
|
||||
taprootState, err := b.deploymentState(
|
||||
node.parent, chaincfg.DeploymentTaproot,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if taprootState == ThresholdActive {
|
||||
scriptFlags |= txscript.ScriptVerifyTaproot
|
||||
}
|
||||
|
||||
// Now that the inexpensive checks are done and have passed, verify the
|
||||
// transactions are actually allowed to spend the coins by running the
|
||||
// expensive ECDSA signature check scripts. Doing this last helps
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue