File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ extern "C" {
60
60
61
61
#define SERVICES_NODE_NETWORK 0x01 // services value indicating a node carries full blocks, not just headers
62
62
#define SERVICES_NODE_BLOOM 0x04 // BIP111: https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki
63
-
63
+ #define SERVICES_NODE_BCASH 0x20 // https://github.com/Bitcoin-UAHF/spec/blob/master/uahf-technical-spec.md
64
+
64
65
#define BR_VERSION "0.6.2"
65
66
#define USER_AGENT "/breadwallet:" BR_VERSION "/"
66
67
Original file line number Diff line number Diff line change @@ -805,14 +805,22 @@ static void _peerConnected(void *info)
805
805
pthread_mutex_lock (& manager -> lock );
806
806
if (peer -> timestamp > now + 2 * 60 * 60 || peer -> timestamp < now - 2 * 60 * 60 ) peer -> timestamp = now ; // sanity check
807
807
808
- // drop peers that don't carry full blocks, or aren't synced yet
809
808
// TODO: XXX does this work with 0.11 pruned nodes?
810
- if (! (peer -> services & SERVICES_NODE_NETWORK ) ||
811
- BRPeerLastBlock (peer ) + 10 < manager -> lastBlock -> height ) {
809
+ if (! (peer -> services & SERVICES_NODE_NETWORK )) {
810
+ peer_log (peer , "node doesn't carry full blocks" );
811
+ BRPeerDisconnect (peer );
812
+ }
813
+ else if (BRPeerLastBlock (peer ) + 10 < manager -> lastBlock -> height ) {
814
+ peer_log (peer , "node isn't synced" );
815
+ BRPeerDisconnect (peer );
816
+ }
817
+ else if ((peer -> services & SERVICES_NODE_BCASH ) == SERVICES_NODE_BCASH ) {
818
+ peer_log (peer , "b-cash nodes not supported" );
812
819
BRPeerDisconnect (peer );
813
820
}
814
821
else if (BRPeerVersion (peer ) >= 70011 && ! (peer -> services & SERVICES_NODE_BLOOM )) {
815
- BRPeerDisconnect (peer ); // drop peers that don't support SPV filtering
822
+ peer_log (peer , "node doesn't support SPV mode" );
823
+ BRPeerDisconnect (peer );
816
824
}
817
825
else if (manager -> downloadPeer && // check if we should stick with the existing download peer
818
826
(BRPeerLastBlock (manager -> downloadPeer ) >= BRPeerLastBlock (peer ) ||
You can’t perform that action at this time.
0 commit comments