Update NewScript example after API change.
This change updates the doc.go documentation file with the correct use
of the new (since 8eead5217d
) API used
for passing additional options when creating new script engines.
Spotted by davec@
This commit is contained in:
parent
8eead5217d
commit
b0899204d9
1 changed files with 5 additions and 1 deletions
6
doc.go
6
doc.go
|
@ -44,8 +44,12 @@ engine to validate a transaction.
|
|||
func ValidateTx(tx *btcwire.MsgTx, txIdx int, txIn *btcwire.MsgTx, txInIdx int, timestamp time.Time) {
|
||||
pkScript := txIn.TxOut[txInIdx].PkScript
|
||||
sigScript := tx.txIn[TxIdx]
|
||||
var flags btcscript.ScriptFlags
|
||||
if timestamp.After(btcscript.Bip16Activation) {
|
||||
flags |= btcscript.ScriptBip16
|
||||
}
|
||||
engine, err := btcscript.NewScript(sigScript, pkScript, txInIdx,
|
||||
tx, timestamp.After(btcscript.Bip16Activation))
|
||||
tx, flags)
|
||||
return engine.Execute()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue