txscript: export StandardVerifyFlags

By exporting StandardVerifyFlags, clients can ensure they create
transactions that btcd will accept into its mempool.

This flag doesn't belong in txscript.  It belongs in a
policy package.  However, this is currently the least worse place.
This commit is contained in:
David Hill
2015-02-26 15:21:12 -05:00
parent c09ef75ba9
commit d9cba7ca6a
3 changed files with 19 additions and 16 deletions

View File

@@ -634,6 +634,23 @@ const (
// ScriptVerifyStrictEncoding defines that signature scripts and
// public keys must follow the strict encoding requirements.
ScriptVerifyStrictEncoding
// StandardVerifyFlags are the script flags which are used when
// executing transaction scripts to enforce additional checks which
// are required for the script to be considered standard. These checks
// help reduce issues related to transaction malleability as well as
// allow pay-to-script hash transactions. Note these flags are
// different than what is required for the consensus rules in that they
// are more strict.
//
// TODO: These flags do not belong here. These flags belong in a
// policy package.
StandardVerifyFlags = ScriptBip16 |
ScriptVerifyDERSignatures |
ScriptVerifyStrictEncoding |
ScriptVerifyMinimalData |
ScriptStrictMultiSig |
ScriptDiscourageUpgradableNops
)
// NewScript returns a new script engine for the provided tx and input idx with