prior to panicing with cap mismatch, try other calculation (#20292)
This commit is contained in:
parent
271381628b
commit
fa5b091b4c
@ -5010,7 +5010,7 @@ impl Bank {
|
|||||||
pub fn update_accounts_hash_with_index_option(
|
pub fn update_accounts_hash_with_index_option(
|
||||||
&self,
|
&self,
|
||||||
use_index: bool,
|
use_index: bool,
|
||||||
debug_verify: bool,
|
mut debug_verify: bool,
|
||||||
slots_per_epoch: Option<Slot>,
|
slots_per_epoch: Option<Slot>,
|
||||||
) -> Hash {
|
) -> Hash {
|
||||||
let (hash, total_lamports) = self
|
let (hash, total_lamports) = self
|
||||||
@ -5034,6 +5034,24 @@ impl Bank {
|
|||||||
("capitalization", self.capitalization(), i64),
|
("capitalization", self.capitalization(), i64),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if !debug_verify {
|
||||||
|
// cap mismatch detected. It has been logged to metrics above.
|
||||||
|
// Run both versions of the calculation to attempt to get more info.
|
||||||
|
debug_verify = true;
|
||||||
|
self.rc
|
||||||
|
.accounts
|
||||||
|
.accounts_db
|
||||||
|
.update_accounts_hash_with_index_option(
|
||||||
|
use_index,
|
||||||
|
debug_verify,
|
||||||
|
self.slot(),
|
||||||
|
&self.ancestors,
|
||||||
|
Some(self.capitalization()),
|
||||||
|
false,
|
||||||
|
slots_per_epoch,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
panic!(
|
panic!(
|
||||||
"capitalization_mismatch. slot: {}, calculated_lamports: {}, capitalization: {}",
|
"capitalization_mismatch. slot: {}, calculated_lamports: {}, capitalization: {}",
|
||||||
self.slot(),
|
self.slot(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user