nonce_manager: remove current nonce load when initialized (#2013)
If nonce was just initialized, no need for store and load. Just return the stored value without load. Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org> Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
This commit is contained in:
parent
4a8a6ad259
commit
3ed83d5dd3
|
@ -43,10 +43,12 @@ where
|
||||||
.map_err(FromErr::from)?;
|
.map_err(FromErr::from)?;
|
||||||
self.nonce.store(nonce.as_u64(), Ordering::SeqCst);
|
self.nonce.store(nonce.as_u64(), Ordering::SeqCst);
|
||||||
self.initialized.store(true, Ordering::SeqCst);
|
self.initialized.store(true, Ordering::SeqCst);
|
||||||
}
|
Ok(nonce)
|
||||||
|
} else {
|
||||||
// return current nonce
|
// return current nonce
|
||||||
Ok(self.nonce.load(Ordering::SeqCst).into())
|
Ok(self.nonce.load(Ordering::SeqCst).into())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async fn get_transaction_count_with_manager(
|
async fn get_transaction_count_with_manager(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in New Issue