Move where we check the Monero node's protocol

The genesis block has a version of 1, so immediately checking (before new
blocks are added) will cause failures.
This commit is contained in:
Luke Parker 2023-03-14 01:54:08 -04:00
parent 48078d0b4b
commit f4e2da2767
No known key found for this signature in database

View file

@ -76,8 +76,6 @@ pub async fn get_miner_tx_output(rpc: &Rpc, view: &ViewPair) -> SpendableOutput
pub async fn rpc() -> Rpc {
let rpc = Rpc::new("http://127.0.0.1:18081".to_string()).unwrap();
// Make sure we recognize the protocol
rpc.get_protocol().await.unwrap();
// Only run once
if rpc.get_height().await.unwrap() != 1 {
@ -94,6 +92,9 @@ pub async fn rpc() -> Rpc {
// Mine 40 blocks to ensure decoy availability
rpc.generate_blocks(&addr, 40).await.unwrap();
// Make sure we recognize the protocol
rpc.get_protocol().await.unwrap();
rpc
}