8 Commits

Author SHA1 Message Date
Ori Newman
1e447432a7 [NOD-28] Move subnetwork consts to subnetworkid package (#197)
* [NOD-28] Move SubnetworkID constants to subnetworkid package

* [NOD-28] change subnetwork id constants to pointers
2019-03-10 12:27:06 +02:00
stasatdaglabs
4be23bff07 [DEV-348] Don't send transactions of wrong sub-network to partial peers, and reject messages of such (#164)
* [DEV-348] Removed a couple of unused methods.

* [DEV-348] Implemented validating incoming transactions for bad partial transactions.

* [DEV-348] Added a (incomplete) filter for propogation of transactions.

* [DEV-348] Implemented filtering inventory by subnetwork.

* [DEV-348] Fixed broken tests.

* [DEV-348] Added test for non-zero payload partial transactions.

* [DEV-348] Added a comment for Config.SubnetworkID.

* [DEV-348] Fixed formatting.

* [DEV-348] Renamed isRemoteTransactionFull to shouldTxBeFull.

* [DEV-348] Added a check for invalid transaction in maybeAcceptTransaction. Added handling for native networks.

* [DEV-348] Fixed formatting.

* [DEV-348] Fixed a bug in transaction validation.

* [DEV-348] Rephrased a comment.

* [DEV-348] Extracted subnetwork compatibility to a method. Wrote a test for it.

* [DEV-348] Removed an unnecessary check over the native subnetwork.
2019-01-22 13:56:40 +02:00
Ori Newman
7093155c3a [DEV-234] Add to txindex method to return the block in which tx was accepted (or indication it was not accepted) (#116)
* [DEV-234] add TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxFirstBlockRegion

* [DEV-234] rename selectedPathSet to selectedPathChain

* [DEV-234] set indexers db as part of index manager initialization

* [DEV-234] remove redudant dag instance in txindex

* [DEV-234] fix TestTxIndexConnectBlock and add DAGParams as part of config in DAGSetup

* [DEV-234] TestTxIndexConnectBlock make K=1 to make calculations easier

* [DEV-234] rename TxAcceptingBlock to BlockThatAcceptedTx

* [DEV-234] update block fields names in txindex_test.go

* [DEV-234] rename selectedPathChain -> selectedPathChainSet
2018-11-05 16:11:54 +02:00
Svarog
8721f0d03f [DEV-253] Remove dependancy on github.com/pkg/errors (#113) 2018-11-01 14:45:59 +02:00
Ori Newman
3ff2ef19e4 [DEV-254] Defer any monkey unpatching (#109) 2018-10-29 12:16:58 +02:00
Ori Newman
65788d4dc0 [DEV-200] convert nonce to uint64 (#90) 2018-10-15 15:17:41 +03:00
Ori Newman
030469f035 [DEV-149] Add test case for CVE-2018-17144 (Bitcoin DoS/Double Spend bug) (#77)
* [DEV-149] Add test case for CVE-2018-17144 (Bitcoin DoS/Double Spend bug)

* [DEV-149] change t.Errorf + return to t.Fatalf

* [DEV-149] fix malformed blocks

* [DEV-149] change test blocks to use simnet genesis
2018-10-09 15:40:00 +03:00
stasatdaglabs
6b302dad7c
[DEV-92] Ensure 100% coverage in blockdag package (#71)
* [DEV-92] Covered lookupPreviousNodes in tests.

* [DEV-92] Covered accept.go in tests.

* [DEV-92] Fixed a typo.

* [DEV-92] Covered blockindex.go in tests.

* [DEV-92] Replaced Errorf + return with Errorf. Added the test case to the error messages.

* [DEV-92] Fixed grammar in a comment.

* [DEV-92] Split casting error checking and ErrorCode checking into separate tests.

* [DEV-92] Improved errors.

* [DEV-92] Made errors a tiny bit more descriptive.
2018-10-08 13:02:15 +03:00