Commit Graph

12 Commits

Author SHA1 Message Date
Andrew Poelstra 7eadf72a1a Add serialize_hex method to do string conversion for serializations 2014-08-22 20:53:49 -07:00
Andrew Poelstra 275c93ab6b Add docs for SimpleDecoder and SimpleEncoder traits 2014-08-01 11:16:18 -07:00
Andrew Poelstra a2ce000b2b Revamp Serializable interface to be similar to Encoder/Encodable
This is a massive simplification, fixes a couple endianness bugs (though
not all of them I don't think), should give a speedup, gets rid of the
`serialize_iter` crap.
2014-08-01 09:01:39 -07:00
Andrew Poelstra a34f2642f1 Implement ToJson for BlockHeader
I think this is what I want to do for everything json-visible...perhaps
I will not be able to keep the macro for it though, since there are
some clever variations on it (e.g. blocks should have their header's
hash as a field, txes should appear as txids unless vebose output is
requested, etc.)
2014-07-28 20:12:10 -07:00
Andrew Poelstra b5b7a6b080 Another workaround for https://github.com/rust-lang/rust/issues/15763 2014-07-25 16:50:58 -07:00
Andrew Poelstra cc942a47f3 Workaround for rustc hiccup in `for` loop restructuring, remove assert from deserialization code
Thanks to the assert change there is a segfault happening :(
2014-07-25 15:52:48 -07:00
Andrew Poelstra fe9ca39736 Send new handshake on reconnect 2014-07-24 12:52:28 -07:00
Andrew Poelstra 9cb86dd21b Change InvalidInput to EndOfFile in several cases 2014-07-22 10:59:58 -07:00
Andrew Poelstra 46969b3396 Replace PatriciaTree with HashMap for UTXO set
We get a speed up (~5%) and memory savings (~10%) on initial sync from
using a HashMap, though it's hard to tell precisely how much savings
because it's quite nonlinear.

I haven't tested de/serialization. Some work needs to be done there to
split up the UTXO set since it takes forever to saveload.
2014-07-20 16:52:00 -07:00
Andrew Poelstra 54e4ea4586 Rename Serializable::hash() to Serializable::bitcoin_hash()
We were conflicting with the Rust stdlib trait Hash, which is used
by various datastructures which need a general hash. Also implement
Hash for Sha256dHash so that we can use bitcoin hashes as keys for
such data structures.
2014-07-19 16:11:55 -07:00
Andrew Poelstra 51038f5810 Add alternate network support to `Blockchain`, `UtxoSet`, `Socket`
Still need to do alternate diffchange rules..
2014-07-18 14:38:35 -07:00
Andrew Poelstra c9ad7c0b58 Initial commit, move into Cargo 2014-07-18 06:56:17 -07:00