mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 09:45:41 +00:00
Small tweaks to staking miner (#3460)
* Fix miner * fix miner * Update utils/staking-miner/src/monitor.rs * Fix width
This commit is contained in:
@@ -122,10 +122,21 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! {
|
||||
|
||||
let mut tx_subscription: Subscription<
|
||||
TransactionStatus<<Block as BlockT>::Hash, <Block as BlockT>::Hash>
|
||||
> = client
|
||||
> = match client
|
||||
.subscribe(&"author_submitAndWatchExtrinsic", params! { bytes }, "author_unwatchExtrinsic")
|
||||
.await
|
||||
.unwrap();
|
||||
{
|
||||
Ok(sub) => sub,
|
||||
Err(why) => {
|
||||
// This usually happens when we've been busy with mining for a few blocks, and now we're receiving the
|
||||
// subscriptions of blocks in which we were busy. In these blocks, we still don't have a solution, so we
|
||||
// re-compute a new solution and submit it with an outdated `Nonce`, which yields most often `Stale`
|
||||
// error. NOTE: to improve this overall, and to be able to introduce an array of other fancy features,
|
||||
// we should make this multi-threaded and do the computation outside of this callback.
|
||||
log::warn!(target: LOG_TARGET, "failing to submit a transaction {:?}. continuing...", why);
|
||||
continue
|
||||
}
|
||||
};
|
||||
|
||||
let _success = while let Some(status_update) = tx_subscription.next().await? {
|
||||
log::trace!(target: LOG_TARGET, "status update {:?}", status_update);
|
||||
|
||||
Reference in New Issue
Block a user