From 71336965a6a76aa05eb5c580ce4bb193ca207a62 Mon Sep 17 00:00:00 2001 From: Stephen Akridge Date: Thu, 15 Nov 2018 19:29:54 -0800 Subject: [PATCH] Limit targets to 4 in bench-tps Transaction got bigger so can only fit 4 targets in a Transaction now. --- src/bin/bench-tps.rs | 2 +- src/thin_client.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/bench-tps.rs b/src/bin/bench-tps.rs index 804cd63c49..471c2fe278 100644 --- a/src/bin/bench-tps.rs +++ b/src/bin/bench-tps.rs @@ -290,7 +290,7 @@ fn do_tx_transfers( } } -const MAX_SPENDS_PER_TX: usize = 5; +const MAX_SPENDS_PER_TX: usize = 4; fn verify_transfer(client: &mut ThinClient, tx: &Transaction) -> bool { if client.poll_for_signature(&tx.signatures[0]).is_err() { println!("no signature"); diff --git a/src/thin_client.rs b/src/thin_client.rs index 3be0e2db20..ce95da68f6 100644 --- a/src/thin_client.rs +++ b/src/thin_client.rs @@ -10,6 +10,7 @@ use cluster_info::{ClusterInfo, ClusterInfoError, NodeInfo}; use hash::Hash; use log::Level; use ncp::Ncp; +use packet::PACKET_DATA_SIZE; use result::{Error, Result}; use rpc_request::RpcRequest; use serde_json; @@ -69,6 +70,7 @@ impl ThinClient { /// does not wait for a response. pub fn transfer_signed(&self, tx: &Transaction) -> io::Result { let data = serialize(&tx).expect("serialize Transaction in pub fn transfer_signed"); + assert!(data.len() < PACKET_DATA_SIZE); self.transactions_socket .send_to(&data, &self.transactions_addr)?; Ok(tx.signatures[0])