Commit Graph

10 Commits

Author SHA1 Message Date
John L. Jegutanis
6add2e5a9b Add custom base58check algorithm (#389) 2018-02-27 21:44:30 +08:00
Justin Turner Arthur
0c2e5c6368 Minor optimizations to Bitcoin tx processing (#214)
* Construct unpacking functions for byte format up front to save time
wasted on parsing format string every iteration.

* Store length ahead of time as the overhead adds up.

* Reduce object attribute lookups in hash functions.

* Clean up lib pkg API changes. Unit test new "public" API members.
Underscore prefix for internal hash module funcs. Make bytes.fromhex a
public function.

* Document recent performance findings.
2017-09-09 11:06:46 +07:00
Neil Booth
7a77637586 Add comprehensive tests of lib/hash.py 2017-07-10 19:01:03 +09:00
Neil Booth
151da40d5b Implement peer discovery protocol
Closes #104

DEFAULT_PORTS now a coin property
A Peer object maintains peer information
Revamp LocalRPC "peers" call to show a lot more information
Have lib/jsonrpc.py take care of handling request timeouts
Save and restore peers to a file
Loosen JSON RPC rules so we work with electrum-server and beancurd which don't follow the spec.
Handle incoming server.add_peer requests
Send server.add_peer registrations if peer doesn't have us or correct ports
Verify peers at regular intervals, forget stale peers, verify new peers or those with updated ports
If connecting via one port fails, try the other
Add socks.py for SOCKS4 and SOCKS5 proxying, so Tor servers can now be reached by TCP and SSL
Put full licence boilerplate in lib/ files
Disable IRC advertising on testnet
Serve a Tor banner file if it seems like a connection came from your tor proxy (see ENVIONMENT.rst)
Retry tor proxy hourly, and peers that are about to turn stale
Report more onion peers to a connection that seems to be combing from your tor proxy
Only report good peers to server.peers.subscribe; always report self if valid
Handle peers on the wrong network robustly
Default to 127.0.0.1 rather than localhost for Python <= 3.5.2 compatibility
Put peer name in logs of connections to it
Update docs
2017-02-18 12:43:45 +09:00
Neil Booth
766da5ed79 Don't maintain a sub_count in controller
Just do a tally occasionally.
It's too tricky to keep it accurate as it double-counts resubscribing to
the same address, for example
2017-01-20 08:09:33 +09:00
Neil Booth
d2ebb80fac Extend copyright notice; improve comments 2016-11-03 16:45:06 +09:00
Neil Booth
6ad8c16c47 Handle a couple more requests. 2016-10-27 07:25:34 +09:00
Neil Booth
334ffdaa4f Begin work on proper server 2016-10-17 20:02:42 +09:00
Neil Booth
64b7554b73 Fix some typos 2016-10-08 17:34:12 +09:00
Neil Booth
a3dbc68614 Initial revision 2016-10-08 17:17:43 +09:00