diff --git a/src/fullnode.rs b/src/fullnode.rs index 46773e0d53a442..2c1bdb811d886b 100644 --- a/src/fullnode.rs +++ b/src/fullnode.rs @@ -6,7 +6,7 @@ use entry_writer; use ncp::Ncp; use packet::BlobRecycler; use rpu::Rpu; -use std::fs::File; +use std::fs::{File, OpenOptions}; use std::io::{sink, stdin, stdout, BufReader}; use std::io::{Read, Write}; use std::net::SocketAddr; @@ -85,9 +85,13 @@ impl FullNode { } else { node.data.current_leader_id = node.data.id.clone(); let outfile_for_leader: Box = match outfile_for_leader { - Some(OutFile::Path(file)) => { - Box::new(File::create(file).expect("opening ledger file")) - } + Some(OutFile::Path(file)) => Box::new( + OpenOptions::new() + .create(true) + .append(true) + .open(file) + .expect("opening ledger file"), + ), Some(OutFile::StdOut) => Box::new(stdout()), None => Box::new(sink()), }; diff --git a/tests/multinode.rs b/tests/multinode.rs index f0142739891b9c..62732b1d4936c0 100644 --- a/tests/multinode.rs +++ b/tests/multinode.rs @@ -7,7 +7,7 @@ extern crate solana; use solana::crdt::TestNode; use solana::crdt::{Crdt, ReplicatedData}; use solana::entry_writer::EntryWriter; -use solana::fullnode::{FullNode, InFile}; +use solana::fullnode::{FullNode, InFile, OutFile}; use solana::logger; use solana::mint::Mint; use solana::ncp::Ncp; @@ -244,7 +244,6 @@ fn test_multi_node_basic() { } #[test] -#[ignore] fn test_boot_validator_from_file() { logger::setup(); let leader = TestNode::new(); @@ -257,7 +256,7 @@ fn test_boot_validator_from_file() { true, InFile::Path(ledger_path.clone()), None, - None, + Some(OutFile::Path(ledger_path.clone())), exit.clone(), ); let leader_balance =