From b0899204d9e33dd0270c9993e2c65ac7e5631514 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Sun, 27 Oct 2013 19:42:45 -0400 Subject: [PATCH] Update NewScript example after API change. This change updates the doc.go documentation file with the correct use of the new (since 8eead5217d6af35b9def1558fc0529bac3af5067) API used for passing additional options when creating new script engines. Spotted by davec@ --- doc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc.go b/doc.go index ebca20c6..4b50547f 100644 --- a/doc.go +++ b/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() }