Commit graph

7 commits

Author SHA1 Message Date
Dave Collins
2eef3720a9 Import btcwire repo into wire directory.
This commit contains the entire btcwire repository along with several
changes needed to move all of the files into the wire directory in
order to prepare it for merging.  This does NOT update btcd or any of the
other packages to use the new location as that will be done separately.

- All import paths in the old btcwire test files have been changed to the
  new location
- All references to btcwire as the package name have been chagned to
  wire
- The coveralls badge has been removed since it unfortunately doesn't
  support coverage of sub-packages

This is ongoing work toward #214.
2015-01-31 14:59:57 -06:00
David Hill
cf754d09bf Initial implementation of BIP0037.
Implement filteradd, filterclear, filterload, and merkleblock.
2014-05-07 23:41:39 -05:00
Dave Collins
6c7f45fdb7 Add 2014 to copyright dates. 2014-01-08 23:44:08 -06:00
Dave Collins
9ee6a8aeb6 Optimize writeElement.
This commit modifies the writeElement function to have a "fast path" which uses type
assertions for all of the types which btcwire write so the more expensive
reflection-based binary.Write can be avoided.

Also, this changes all cases that were writing raw ShaHash (32-byte) arrays (which
requires a stack copy) instead simply passing the pointer.

The following benchmark results show the results for serializing a block header
after these changes:

Before: BenchmarkWriteBlockHeader         500000              5566 ns/op
After:  BenchmarkWriteBlockHeader        1000000               991 ns/op

This is part of the ongoing effort to optimize serialization as noted in
conformal/btcd#27.
2013-11-07 00:56:20 -06:00
Dave Collins
93d86305a2 Deprecate InvVect_* constants in favor of InvType*.
This commit changes the InvVect_* constants, which are not standard Go
style, to the InvType*. In order to preserve backwards compatibility, it
also adds a legacy.go file which maps the old public constant names to the
new ones.

Closes #1.
2013-10-08 15:44:48 -05:00
Dave Collins
81120958f0 Comment inventory vector constants. 2013-07-27 16:42:23 -05:00
Dave Collins
69b27dd5d3 Initial implementation. 2013-05-08 18:58:29 -05:00