revert short reorg limit. Add some comments to dailysnapshot
This commit is contained in:
@@ -656,8 +656,12 @@ std::vector <std::pair<CAmount, CTxDestination>> vAddressSnapshot;
|
||||
|
||||
bool komodo_dailysnapshot(int32_t height)
|
||||
{
|
||||
int reorglimit = 10; // CHANGE BACK TO 100 AFTER TESTING!
|
||||
int reorglimit = 100;
|
||||
uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,undo_height,extraoffset;
|
||||
// NOTE: To make this 100% safe under all sync conditions, it should be using a notarized notarization, from the DB.
|
||||
// Under heavy reorg attack, its possible `komodo_notarized_height` can return a height that can't be found on chain sync.
|
||||
// However, the DB can reorg the last notarization. By using 2 deep, we know 100% that the previous notarization cannot be reorged by online nodes,
|
||||
// and as such will always be notarizing the same height. May need to check heights on scan back to make sure they are confirmed in correct order.
|
||||
if ( (extraoffset= height % KOMODO_SNAPSHOT_INTERVAL) != 0 )
|
||||
{
|
||||
// we are on chain init, and need to scan all the way back to the correct height, other wise our node will have a diffrent snapshot to online nodes.
|
||||
|
||||
Reference in New Issue
Block a user