27 Commits

Author SHA1 Message Date
Ori Newman
7371120481 [NOD-333] Make ExtractScriptPubKeyAddrs return single address (#415)
* [NOD-333] Make ExtractScriptPubKeyAddrs return single address

* [NOD-333] Remove reference to required signatures from ExtractScriptPubKeyAddrs
2019-09-19 11:19:51 +03:00
Ori Newman
a789680db1 [NOD-314] change pkscript to scriptpubkey (#400)
* [NOD-314] Change everywhere PkScript to ScriptPubKey

* [NOD-314] Change everywhere PkScript to ScriptPubKey

* [NOD-314] Rename pkPops -> scriptPubKeyPops
2019-09-15 11:09:36 +03:00
Ori Newman
c14c64d534 [NOD-224] Make P2PK and raw Multisig non-standard (#332) 2019-06-27 12:44:22 +03:00
Svarog
0c5f3d72bd [NOD-223] Removed Nulldata as standard tx type (#329)
* [NOD-223] Removed Nulldata as standard tx type

* [NOD-223] Removed redundant space
2019-06-16 16:31:38 +03:00
Ori Newman
1cd82fcd3b [DEV-91] Ensure 100% coverage in mempool package (#60)
* [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
2018-09-27 12:09:19 +03:00
Ori Newman
b4b71eec01 [DEV-98] Move script flags from relay rules to consensus (#49)
* [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
2018-08-23 17:45:49 +03:00
stasatdaglabs
c65d9aa168 [DEV-97] Combine btcd and btcutil repositories (#51)
* [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.
2018-08-23 16:54:16 +03:00
Mike Zak
1631998091 Merge remote-tracking branch 'origin/master' into dev-20-primitive-blockdag 2018-07-12 16:23:55 +03:00
Svarog
b7a9f39dc6 [DEV-58] removed addition of multisig dummy in signMultiSig
* [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
2018-07-08 10:33:02 +03:00
Svarog
0acf0eb516 [DEV-56] Remove any occurance of OP_CODESEPARATOR
* [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
2018-07-05 18:58:13 +03:00
Svarog
3f3a10c695 [DEV-53] SigHashSingle now errors when the index is wrong
* [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
2018-07-04 11:09:40 +03:00
Mike Zak
d92690f7e5 Merge remote-tracking branch 'origin/master' into dev-20-primitive-blockdag 2018-07-01 15:58:02 +03:00
Svarog
8195acd0bb
[DEV-49] Renamed all opcodes consts to be CamelCase (#16) 2018-07-01 15:52:05 +03:00
Stas Boutenko
a26fd21ae7 [DEV-32] Renamed chaincfg to dagconfig and chainhash to daghash. 2018-06-19 18:19:54 +03:00
Mike Zak
e3079c7e79 [DEV-14] Removed SegWit from txscript package! 2018-06-11 09:58:48 +03:00
Stas Boutenko
2901d302f3 Updated references. 2018-06-03 18:34:09 +03:00
Marko Bencun
16dbb2602a txscript: export calcSignatureHash
This is a useful function for users of this library, and deserves to
be public.
2018-01-25 23:14:55 -06:00
Olaoluwa Osuntokun
98cae74275 BIP0143+txscript: add segwit sighash, signing, and HashCache integration
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.
2017-08-13 23:17:40 -05:00
Steven Roose
bf43e56f2f Fix warnings from ineffassign
I left one at the end of fullblocktest, since I suspected the unused
variable assignments there were set for the possibility of extending the
tests.
2017-06-07 17:59:33 -05:00
David Hill
807d344fe9 Unassign some TODO's 2016-11-15 17:47:33 -06:00
Dave Collins
14b51fc5f8
multi: Correct misspellings detected by misspell. 2016-10-28 09:43:38 -05:00
Dave Collins
cee207c64c txscript: Expose AddOps on ScriptBuilder. (#734)
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.
2016-08-12 19:29:28 -05:00
Dave Collins
eb882f39f8 multi: Fix several misspellings in the comments.
This commit corrects several typos in the comments found by misspell.
2016-02-25 11:17:12 -06:00
Jonathan Gillham
8fcea82a56 Fixed erroneous txscript.KeyClosure documentation. 2015-07-19 16:15:29 +01:00
Dave Collins
6e402deb35 Relicense to the btcsuite developers.
This commit relicenses all code in this repository to the btcsuite
developers.
2015-05-01 12:00:56 -05:00
Dave Collins
a8fe1ad5fe txscript: Code consistency and doco improvements.
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
2015-04-29 13:16:22 -05:00
Dave Collins
3fc2444309 txscript: Separate signing code.
This commit separate the transaction signing code into sign.go and the
related tests into sign_test.go.
2015-04-20 17:00:23 -05:00