cleaning up
This commit is contained in:
parent
c19bf38801
commit
fdd78009a2
|
@ -50,15 +50,6 @@ impl Services {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn bitcoin_cash(&self) -> bool {
|
|
||||||
self.bit_at(5)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn with_bitcoin_cash(mut self, v: bool) -> Self {
|
|
||||||
self.set_bit(5, v);
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn includes(&self, other: &Self) -> bool {
|
pub fn includes(&self, other: &Self) -> bool {
|
||||||
self.0 & other.0 == other.0
|
self.0 & other.0 == other.0
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,6 @@ impl Context {
|
||||||
|
|
||||||
let needed = context.connection_counter.outbound_connections_needed() as usize;
|
let needed = context.connection_counter.outbound_connections_needed() as usize;
|
||||||
if needed != 0 {
|
if needed != 0 {
|
||||||
// TODO: pass Services::with_bitcoin_cash(true) after HF block
|
|
||||||
let used_addresses = context.connections.addresses();
|
let used_addresses = context.connections.addresses();
|
||||||
let peers = context.node_table.read().nodes_with_services(&Services::default(), context.config.internet_protocol, &used_addresses, needed);
|
let peers = context.node_table.read().nodes_with_services(&Services::default(), context.config.internet_protocol, &used_addresses, needed);
|
||||||
let addresses = peers.into_iter()
|
let addresses = peers.into_iter()
|
||||||
|
|
|
@ -607,9 +607,9 @@ mod tests {
|
||||||
let s0: SocketAddr = "127.0.0.1:8000".parse().unwrap();
|
let s0: SocketAddr = "127.0.0.1:8000".parse().unwrap();
|
||||||
let s1: SocketAddr = "127.0.0.1:8001".parse().unwrap();
|
let s1: SocketAddr = "127.0.0.1:8001".parse().unwrap();
|
||||||
|
|
||||||
let mut table = NodeTable::new(Services::default().with_network(true).with_bitcoin_cash(true));
|
let mut table = NodeTable::new(Services::default().with_network(true).with_xthin(true));
|
||||||
table.insert(s0, Services::default().with_network(true));
|
table.insert(s0, Services::default().with_network(true));
|
||||||
table.insert(s1, Services::default().with_network(true).with_bitcoin_cash(true));
|
table.insert(s1, Services::default().with_network(true).with_xthin(true));
|
||||||
assert_eq!(table.nodes_with_services(&Services::default(), InternetProtocol::default(), &HashSet::new(), 1)[0].address(), s1);
|
assert_eq!(table.nodes_with_services(&Services::default(), InternetProtocol::default(), &HashSet::new(), 1)[0].address(), s1);
|
||||||
|
|
||||||
table.note_failure(&s1);
|
table.note_failure(&s1);
|
||||||
|
|
|
@ -9,15 +9,6 @@ args:
|
||||||
- regtest:
|
- regtest:
|
||||||
long: regtest
|
long: regtest
|
||||||
help: Use a private network for regression tests.
|
help: Use a private network for regression tests.
|
||||||
- btc:
|
|
||||||
long: btc
|
|
||||||
help: Use Bitcoin Core verification rules (BTC).
|
|
||||||
- bch:
|
|
||||||
long: bch
|
|
||||||
help: Use Bitcoin Cash verification rules (BCH).
|
|
||||||
- zcash:
|
|
||||||
long: zcash
|
|
||||||
help: Use ZCash verification rules (ZCH).
|
|
||||||
- connect:
|
- connect:
|
||||||
short: c
|
short: c
|
||||||
long: connect
|
long: connect
|
||||||
|
|
|
@ -103,7 +103,5 @@ pub enum TransactionError {
|
||||||
UnspentTransactionWithTheSameHash,
|
UnspentTransactionWithTheSameHash,
|
||||||
/// Using output that is surely spent
|
/// Using output that is surely spent
|
||||||
UsingSpentOutput(H256, u32),
|
UsingSpentOutput(H256, u32),
|
||||||
/// Transaction, protected using BitcoinCash OP_RETURN replay protection (REQ-6-1).
|
|
||||||
ReturnReplayProtection,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue