mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-23 19:15:59 +00:00
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:
parent
48078d0b4b
commit
f4e2da2767
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue