mirror of
https://github.com/mimblewimble/grin-wallet.git
synced 2025-01-20 19:11:09 +03:00
parent
db6babfd72
commit
0d8689663b
1 changed files with 23 additions and 1 deletions
|
@ -22,6 +22,7 @@ use crate::core::core::TxKernel;
|
||||||
use crate::libwallet::{NodeClient, NodeVersionInfo, TxWrapper};
|
use crate::libwallet::{NodeClient, NodeVersionInfo, TxWrapper};
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::env;
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
|
|
||||||
use crate::client_utils::Client;
|
use crate::client_utils::Client;
|
||||||
|
@ -200,7 +201,28 @@ impl NodeClient for HTTPNodeClient {
|
||||||
|
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
|
|
||||||
for query_chunk in query_params.chunks(200) {
|
// Using an environment variable here, as this is a temporary fix
|
||||||
|
// and doesn't need to be permeated throughout the application
|
||||||
|
// configuration
|
||||||
|
let chunk_default = 200;
|
||||||
|
let chunk_size = match env::var("GRIN_OUTPUT_QUERY_SIZE") {
|
||||||
|
Ok(s) => match s.parse::<usize>() {
|
||||||
|
Ok(c) => c,
|
||||||
|
Err(e) => {
|
||||||
|
error!(
|
||||||
|
"Unable to parse GRIN_OUTPUT_QUERY_SIZE, defaulting to {}",
|
||||||
|
chunk_default
|
||||||
|
);
|
||||||
|
error!("Reason: {}", e);
|
||||||
|
chunk_default
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(_) => chunk_default,
|
||||||
|
};
|
||||||
|
|
||||||
|
trace!("Output query chunk size is: {}", chunk_size);
|
||||||
|
|
||||||
|
for query_chunk in query_params.chunks(chunk_size) {
|
||||||
let url = format!("{}/v1/chain/outputs/byids?{}", addr, query_chunk.join("&"),);
|
let url = format!("{}/v1/chain/outputs/byids?{}", addr, query_chunk.join("&"),);
|
||||||
tasks.push(client.get_async::<Vec<api::Output>>(url.as_str(), self.node_api_secret()));
|
tasks.push(client.get_async::<Vec<api::Output>>(url.as_str(), self.node_api_secret()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue