Matt Corallo
fe917765c0
Drop message decode max length to 4_000_000
...
It has been a long time since Bitcoin's maximum network message
length was 32MB, so we should follow suit. This is also an important
DoS limit, so we should limit it as much as possible.
2019-11-06 16:29:21 -05:00
Carl Dong
242ce14cee
Add reject message ( #323 )
...
Add reject message
2019-09-30 14:52:19 +00:00
Dr. Maxim Orlovsky
4b1d4edc14
Improvements to `StreamReader` ( #318 )
...
* Generalizing StreamReader to support arbitrary data structures
* Using Read trait and adding test cases
2019-09-23 08:31:52 +02:00
practicalswift
0b08978af2
Fix incorrect documentation for is_p2pk(...) ( #331 )
2019-09-21 13:33:44 +02:00
Tamas Blummer
1b0e31c233
fixed typo
2019-09-21 13:31:03 +02:00
Tamas Blummer
960e3da75b
remove #repr on RejectReason
...
and typo fix
2019-09-10 20:11:25 +02:00
Tamas Blummer
c93b1ed8ce
add reverse mapping
2019-09-03 19:59:48 +02:00
Tamas Blummer
3266c192b6
add reject message
2019-08-27 13:42:46 +02:00
Tamas Blummer
38d5ae4e3f
enable serde serialization for block and blockheader
2019-08-24 14:26:18 +02:00
Carl Dong
24361dd2f1
Merge pull request #298 from tamasblummer/upgrade_secp_bitcoinconsensus
...
upgrade to secp256k1 0.15 and bitcoinconsensus 0.17
2019-08-23 14:18:05 -04:00
Tamás Blummer
f01568c85a
use lambda instead of a hash map to find spent outputs ( #319 )
...
* use lambda instead of a hash map to find spent outputs
* check for double use of an input
2019-08-23 18:49:31 +02:00
Tamas Blummer
9f3e355c5c
upgrade to secp256k1 0.15 and bitcoinconsensus 0.17
2019-08-21 19:04:40 +02:00
Elichai Turkel
52ff97cddc
Deny unused imports and remove unneeded
2019-08-19 13:29:43 -04:00
Elichai Turkel
747e9ce75c
Pinned serde version and re-export bech32
2019-08-16 16:08:14 -04:00
Steven Roose
c01172780b
Re-export bitcoin_hashes and secp256k1 dependency
2019-08-16 15:52:58 +01:00
Steven Roose
48f4c1989f
Rename bitcoin_hashes dependency to hashes
2019-08-16 15:52:27 +01:00
Steven Roose
09a65023a2
Add tests for p2shwpkh and p2shwsh
2019-08-15 22:29:09 +01:00
Steven Roose
170abaa82f
Use the new bech32 functions
2019-08-15 22:29:06 +01:00
Steven Roose
3a93f8522c
Format address module
2019-08-15 22:28:46 +01:00
Steven Roose
8de13a3915
Redo the BIP-173 test vectors
...
Before, non-version-zero segwit addresses were not included.
2019-08-15 22:28:27 +01:00
Steven Roose
e469fec839
address: Drop error::Error::description impl
2019-08-15 22:28:25 +01:00
Steven Roose
bfdcfee28e
Add Address::from_script constructor
2019-08-15 22:28:20 +01:00
Steven Roose
33e8ba3c7e
Extract roundtrip method from Address tests
2019-08-13 08:47:17 +01:00
Steven Roose
8804a41f1f
Add AddressType enum
2019-08-13 08:47:15 +01:00
Steven Roose
7e0d997150
Remove unused encode::Error variant
2019-08-13 08:47:13 +01:00
Steven Roose
385a657974
Refactor Address
...
- use AddressError instead of encode::Error
- replace using bech32-bitcoin with Payload::WitnessProgram variant
2019-08-13 08:47:10 +01:00
Andrew Poelstra
cc0f1143dc
Merge pull request #309 from elichai/2019-08-amount-precision
...
Check that the amount precision isn't more than the size of the amount
2019-08-12 17:20:18 +00:00
Riccardo Casatta
7d6687451a
use BTreeMap instead of HashMap to always serialize the same ( #310 )
...
* use BTreeMap instead of HashMap to always serialize the same
* fix rust 1.22 error
* psbt fuzz roundtrip
* psbt fuzz roundtrip on our ser
2019-08-09 17:03:12 +02:00
Tamás Blummer
4ddf6f80b9
Reduce blockfilter memory ( #302 )
...
* use same Error type in all methods of BlockFilter
* reduce Blockfilter memory footprint
* amend the example use
* remove unused constant
2019-08-09 16:58:02 +02:00
Elichai Turkel
a9e65f36d3
Check that the amount precision isn't more than the size of the amount
2019-08-09 10:41:21 -04:00
Elichai Turkel
4a1830c423
Replaced Read trait with a generic over Read ( #307 )
...
Removed tempfile usage from stream_reader
2019-08-07 17:35:22 +02:00
Andrew Poelstra
db8c8b497b
Merge pull request #303 from practicalswift/typos
...
Fix typos
2019-08-05 15:16:17 +00:00
Aleru
40c5a568fa
add TODOs
2019-08-04 22:27:59 -04:00
practicalswift
8152ed758c
Fix typos
2019-08-04 19:27:36 +00:00
Steven Roose
cc2ede7a80
Use `$crate::` prefix for uses in macros
2019-07-29 11:30:35 +02:00
Steven Roose
2c2d55d90a
bip32: Implement hex serialization for Fingerprint and ChainCode
2019-07-26 15:32:33 +02:00
Steven Roose
4530e403e0
Use collect_str instead of serialize_str in serde macros
2019-07-26 15:30:47 +02:00
Steven Roose
fc6415d652
Add human-readable serde for OutPoint as `<txid>:<vout>`
2019-07-26 15:30:46 +02:00
Steven Roose
3c66418f3a
bip32: Add serde for Extended(Priv|Pub)Key
2019-07-26 15:30:44 +02:00
Tamás Blummer
c93a70487f
Add client side block filter (BIP158) ( #281 )
...
* add client side block filters with code from murmel. use siphash from bitcoin_hashes pass Bitcoin Core tests upgrade to bitcoin_hashes 0.7
* add filter.filter_id() test use BlockFilter directly
* fixed edge cases of matching empty query sets or or using empty filter
2019-07-26 09:36:25 +02:00
Andrew Poelstra
b6c1266102
Merge pull request #293 from stevenroose/bip143-script-code
...
bip143: Rename witness_script to script_code
2019-07-24 22:43:58 +00:00
Andrew Poelstra
a041168205
Merge pull request #265 from apoelstra/2019-05-enc-dec-cleanup
...
clean up encoding/decoding traits
2019-07-24 19:30:21 +00:00
Tamas Blummer
ff2f5d9ec2
forbid unsafe
2019-07-23 23:29:45 +02:00
Steven Roose
b312c4de6a
bip143: Rename witness_script to script_code
...
For p2wsh the scriptCode is the witness script, but for p2wpkh, it's the
equivalent legacy p2pkh output script.
The name scriptCode is used in the BIP, so it's less confusing.
2019-07-15 17:33:23 +02:00
Andrew Poelstra
3b9a94a178
eliminate type parameter from the `Decodable` trait
2019-07-11 17:23:01 +00:00
Andrew Poelstra
42960b959f
eliminate type parameter from `Encodable` trait
2019-07-11 17:21:19 +00:00
Andrew Poelstra
87e7ebcf1b
prevent compilation on 16-bit targets so we can use `usize` and assume it is 32 bits
2019-07-11 17:15:33 +00:00
Andrew Poelstra
b734d6488a
make consensus_encode return the encoded length
2019-07-11 17:15:32 +00:00
Andrew Poelstra
abb9210c04
make `VarInt::len` and `Transaction::get_weight` return a usize
2019-07-11 17:14:05 +00:00
Andrew Poelstra
7e6ad7c893
rename Encoder to WriteExt and Decoder to ReadExt
2019-07-11 15:01:38 +00:00