* [DEV-91] add tests for RemoveOrphansByTag
* [DEV-91] Add tests for orphan tx expiration
* [DEV-91] add TestDoubleSpends
* [DEV-91] add TestFetchTransaction
* [DEV-91] added a test for MinHighPriority
* [DEV-91] test unparsable scripts
* [DEV-91] test MaxOrphanTxs=0
* [DEV-91] add TestRemoveTransaction
* [DEV-105] use utxodiff in mempool instead of utxoview
* [DEV-105] get rid of utxoview
* [DEV-105] fix tests to use utxoset
* [DEV-105] remove utxoview type
* [DEV-105] move DagSetup to test_utils.go
* [DEV-105] add comments and add blockdag/test_utils_test.go
* [DEV-105] change checkPoolDoubleSpend to check utxodiff
* [DEV-105] add restoreInputs arg to removeTransaction
* [DEV-91] add restoreInputs arg to removeTransaction in unit tests
* [DEV-105] add restoreInputs arg to removeTransaction
* [DEV-105] give more descriptive names to vars
* [DEV-115] close txChan outside of HandleNewBlock
* [DEV-105] rename DagSetup -> DAGSetup
* [DEV-91] remove IsSpentInDiff
* [DEV-91] fix comment
* [DEV-91] Make IsPushOnlyScript return an error if the script cannot be parsed
* [DEV-91] add more tests for IsPushOnlyScript
* [DEV-91] fix comments
* [DEV-98] Move script flags from relay rules to consensus
* [DEV-98] remove flags from script_tests.json
* [DEV-98] fix multisig and remove test that assume no minimal data rule
* [DEV-98] rename bip16 bool to isP2sh
* [DEV-98] add sighash type to overly long signature in script_tests.json
* [DEV-98] add test for NUMEQUAL for non equal numbers script_tests.json
* [DEV-98] remove debugging if
* [DEV-98] remove ErrCleanStack from EVAL_FALSE
* [DEV-98] change isP2sh to isP2SH to comply with Go style
* [DEV-98] add ScriptNoFlags to explictly indicate for empty ScriptFlags
* [DEV-98] rename ErrPubKeyType -> ErrPubKeyFormat
* [DEV-98] rename PUBKEYTYPE -> PUBKEYFORMAT
* [DEV-97] Moved github.com/daglabs/btcutil into github.com/daglabs/btcd/btcutil.
* [DEV-97] Updated Gopkg.toml to no longer refer to btcutil.
* [DEV-97] Renamed btcutil to util.
* [DEV-56] Remove any occurance of OP_CODESEPARATOR
* [DEV-56] Modified sighash tests to exclude OP_CODESEPARATOR
* [DEV-56] Fixed sighash.json to not include any codeseparators at all
* [DEV-56] Reformatted sighash.json
* [DEV-56] Rename any instance of subScript to script
* [DEV-56] Extracted check for opUnknown to separate function
* [DEV-58] removed addition of multisig dummy in signMultiSig
* [DEV-58] Removed temporary code for test cleanup
* [DEV-56] Remove any occurance of OP_CODESEPARATOR
* [DEV-56] Modified sighash tests to exclude OP_CODESEPARATOR
* [DEV-56] Fixed sighash.json to not include any codeseparators at all
* [DEV-56] Reformatted sighash.json
* [DEV-56] Rename any instance of subScript to script
* [DEV-56] Extracted check for opUnknown to separate function
* [DEV-58] Removed temporary code for test cleanup
* [DEV-50] Remove the Multisig bug requiring a dummy push
* [DEV-53] SigHashSingle now errors when the index is wrong
* [DEV-53] Fixed tests for SIGHASH_SINGLE
* [DEV-53] Removed redundant part of comment
This commit implements most of BIP0143 by adding logic to implement the
new sighash calculation, signing, and additionally introduces the
HashCache optimization which eliminates the O(N^2) computational
complexity for the SIGHASH_ALL sighash type.
The HashCache struct is the equivalent to the existing SigCache struct,
but for caching the reusable midstate for transactions which are
spending segwitty outputs.
This exposes a new function on the ScriptBuilder type named AddOps that
allows multiple opcodes to be added via a single call and adds tests to
exercise the new function.
Finally, it updates a couple of places in the signing code that were
abusing the interface by setting its private script directly to use the
new public function instead.
This commit contains a lot of cleanup on the txscript code to make it
more consistent with the code throughout the rest of the project. It
doesn't change any operational logic.
The following is an overview of the changes:
- Add a significant number of comments throughout in order to better
explain what the code is doing
- Fix several comment typos
- Move a couple of constants only used by the engine to engine.go
- Move a variable only used by the engine to engine.go
- Fix a couple of format specifiers in the test prints
- Reorder functions so they're defined before/closer to use
- Make the code lint clean with the exception of the opcode definitions