Multi-mode logging. (#1643)

* Multi-mode logging.

Better for miners (they get immediate notification of new block).
Better for general use (less superfluous information shown).

* Remove comment.

[ci:skip]

* Minor string change

[ci:skip]

* Minor message tweak.

* Minor tweaks and indentation fix.
This commit is contained in:
Gav Wood
2016-07-17 23:00:57 +02:00
committed by GitHub
parent 34b7cf2e0a
commit 0d2f516ad7
6 changed files with 124 additions and 103 deletions

View File

@@ -71,25 +71,25 @@ impl<C: 'static, M: 'static> PersonalSigner for SignerClient<C, M> where C: Mini
let client = take_weak!(self.client);
let miner = take_weak!(self.miner);
queue.peek(&id).and_then(|confirmation| {
let mut request = confirmation.transaction;
// apply modification
if let Some(gas_price) = modification.gas_price {
request.gas_price = Some(gas_price.into());
}
let mut request = confirmation.transaction;
// apply modification
if let Some(gas_price) = modification.gas_price {
request.gas_price = Some(gas_price.into());
}
let sender = request.from;
let sender = request.from;
match unlock_sign_and_dispatch(&*client, &*miner, request, &*accounts, sender, pass) {
Ok(hash) => {
queue.request_confirmed(id, Ok(hash.clone()));
Some(to_value(&hash))
},
_ => None
}
})
.unwrap_or_else(|| {
to_value(&false)
})
match unlock_sign_and_dispatch(&*client, &*miner, request, &*accounts, sender, pass) {
Ok(hash) => {
queue.request_confirmed(id, Ok(hash.clone()));
Some(to_value(&hash))
},
_ => None
}
})
.unwrap_or_else(|| {
to_value(&false)
})
}
)
}