Commit Graph

13 Commits

Author SHA1 Message Date
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
551c04a3bc Remove all uses of "except:" 2017-01-25 20:28:19 +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
2b2909f1c4 Move to hashX
The hashX of a script is the first 11 bytes of its sha256 hash.

Closes #72.
2017-01-07 11:51:01 +09:00
Neil Booth
9ac4718218 OP_RETURN can be spent inside false conditions
See tx 928ed84cd4c48beb0d3494ccc17cc1e06b1473f9dc118db9bb56972395ede461
2016-11-13 21:55:18 +09:00
Neil Booth
85786b87a2 Save all UTXOs
Change the DB version
2016-11-13 20:35:03 +09:00
Neil Booth
8e6e8329ac Remove dead code.
Also use native python3 functions to speed up 2 lib functions
2016-11-08 19:14:52 +09:00
Neil Booth
e7a516c46e Need to catch script errors 2016-11-06 16:01:02 +09:00
Neil Booth
3ab07c1fb6 Speed up script parsing for ~3% faster throughput
Also improves the coin abstraction
2016-11-06 14:32:27 +09:00
Neil Booth
d2ebb80fac Extend copyright notice; improve comments 2016-11-03 16:45:06 +09:00
Neil Booth
6644102441 Use hash168 to distinguish address types in DB 2016-10-10 11:42:33 +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