Skip to content

Commit

Permalink
Restore getaddressunspent
Browse files Browse the repository at this point in the history
Also adds a sleep in case electrumx is simply slow to index
  • Loading branch information
kayabaNerve committed May 13, 2024
1 parent 1f8dc56 commit b763ecc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coins/btc/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ impl BtcRpc {
}

pub async fn get_spendable(&self, address: &str) -> anyhow::Result<Vec<UnspentInputResponse>> {
self.rpc_call("getaddressunspent", &json!({"addresses": [address]})).await
tokio::time::sleep(core::time::Duration::from_secs(10)).await;
self.rpc_call("getaddressunspent", &[address]).await
}

pub async fn get_fee_per_byte(&self) -> anyhow::Result<u64> {
Expand Down

0 comments on commit b763ecc

Please sign in to comment.