Limit the size of gossip push and gossip pull response (#5348)
* Limit the size of gossip push and gossip pull response * Remove Default::default * Rename var
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::contact_info::ContactInfo;
|
||||
use bincode::serialize;
|
||||
use bincode::{serialize, serialized_size};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::{Keypair, Signable, Signature};
|
||||
use solana_sdk::transaction::Transaction;
|
||||
@@ -189,6 +189,11 @@ impl CrdsValue {
|
||||
CrdsValueLabel::EpochSlots(*key),
|
||||
]
|
||||
}
|
||||
|
||||
/// Returns the size (in bytes) of a CrdsValue
|
||||
pub fn size(&self) -> u64 {
|
||||
serialized_size(&self).expect("unable to serialize contact info")
|
||||
}
|
||||
}
|
||||
|
||||
impl Signable for CrdsValue {
|
||||
|
||||
Reference in New Issue
Block a user