Started inf networking

This commit is contained in:
arkpar
2016-08-15 14:25:57 +02:00
committed by keorn
parent 535c502771
commit 207f9d02f2
7 changed files with 259 additions and 10 deletions

View File

@@ -40,6 +40,10 @@ pub trait ChainNotify : Send + Sync {
fn stop(&self) {
// does nothing by default
}
/// fires when chain broadcasts a message
fn broadcast(&self, _data: Vec<u8>) {
}
}
impl IpcConfig for ChainNotify { }

View File

@@ -1020,6 +1020,10 @@ impl BlockChainClient for Client {
fn pending_transactions(&self) -> Vec<SignedTransaction> {
self.miner.pending_transactions()
}
fn queue_infinity_message(&self, _message: Bytes) {
//TODO: handle message here
}
}
impl MiningBlockChainClient for Client {

View File

@@ -554,6 +554,10 @@ impl BlockChainClient for TestBlockChainClient {
self.miner.import_external_transactions(self, txs);
}
fn queue_infinity_message(&self, _packet: Bytes) {
unimplemented!();
}
fn pending_transactions(&self) -> Vec<SignedTransaction> {
self.miner.pending_transactions()
}

View File

@@ -182,6 +182,9 @@ pub trait BlockChainClient : Sync + Send {
/// Queue transactions for importing.
fn queue_transactions(&self, transactions: Vec<Bytes>);
/// Queue packet
fn queue_infinity_message(&self, packet: Bytes);
/// list all transactions
fn pending_transactions(&self) -> Vec<SignedTransaction>;