Validating an empty chain no longer panics (#850)
This commit is contained in:
committed by
Ignotus Peverell
parent
68b6bd25a4
commit
90a7f3d0f6
@@ -413,6 +413,12 @@ impl Chain {
|
||||
/// Validate the current chain state.
|
||||
pub fn validate(&self, skip_rproofs: bool) -> Result<(), Error> {
|
||||
let header = self.store.head_header()?;
|
||||
|
||||
// Lets just treat an "empty" node that just got started up as valid.
|
||||
if header.height == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut txhashset = self.txhashset.write().unwrap();
|
||||
|
||||
// Now create an extension from the txhashset and validate
|
||||
|
||||
Reference in New Issue
Block a user