Skip to content

Commit

Permalink
Have electrumx update more frequently
Browse files Browse the repository at this point in the history
The lack of data population on the expected timeline is causing failures.
  • Loading branch information
kayabaNerve committed May 13, 2024
1 parent 5b6f2dd commit a22bec4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/setup-coins/litecoin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ popd

mkdir -p /var/electrumx/db
chmod 777 -R /var/electrumx/db
ALLOW_ROOT=true COIN=Litecoin NET=regtest DB_DIRECTORY="/var/electrumx/db" DAEMON_URL="ci:[email protected]:19443" SERVICES="tcp://127.0.0.1:5000" PEER_DISCOVERY=self ./electrumx/venv/bin/python3 ./electrumx/electrumx_server &
ALLOW_ROOT=true COIN=Litecoin NET=regtest DB_DIRECTORY="/var/electrumx/db" DAEMON_URL="ci:[email protected]:19443" SERVICES="tcp://127.0.0.1:5000" DAEMON_POLL_INTERVAL_BLOCKS=1000 DAEMON_POLL_INTERVAL_MEMPOOL=1000 PEER_DISCOVERY=self ./electrumx/venv/bin/python3 ./electrumx/electrumx_server &
sleep 1

./electrum-ltc/run_electrum --regtest --offline setconfig rpcport 3000
Expand Down
4 changes: 4 additions & 0 deletions src/coins/btc/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl BtcRpc {
}

pub async fn get_spendable(&self, address: &str) -> anyhow::Result<Vec<UnspentInputResponse>> {
#[cfg(test)]
tokio::time::delay_for(core::time::Duration::from_secs(10)).await;
self.rpc_call("getaddressunspent", &[address]).await
}
Expand All @@ -112,6 +113,9 @@ impl BtcRpc {
}

pub async fn get_address_history(&self, address: &str) -> Vec<AddressHistoryItem> {
#[cfg(test)]
tokio::time::delay_for(core::time::Duration::from_secs(10)).await;

#[derive(Deserialize, Debug)]
struct AddressHistoryResponse {
fee: Option<u64>,
Expand Down

0 comments on commit a22bec4

Please sign in to comment.