Skip to content

Commit

Permalink
fix kernel mainnet network id check
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfung committed Jan 30, 2024
1 parent f707055 commit f49015b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kernel/cosi.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,11 +754,11 @@ func (chain *Chain) cosiHandleFinalization(m *CosiAction) error {

tx, _, err := chain.node.validateSnapshotTransaction(s, true)
if err != nil {
logger.Verbosef("ERROR handleFinalization checkFinalSnapshotTransaction %s %s %d %v\n",
logger.Verbosef("ERROR handleFinalization validateSnapshotTransaction %s %s %d %v\n",
m.PeerId, s.Hash, chain.node.ConsensusThreshold(s.Timestamp, true), err)
return nil
} else if tx == nil {
logger.Verbosef("ERROR handleFinalization checkFinalSnapshotTransaction %s %s %d %s\n",
logger.Verbosef("ERROR handleFinalization validateSnapshotTransaction %s %s %d %s\n",
m.PeerId, s.Hash, chain.node.ConsensusThreshold(s.Timestamp, true), "tx empty")
m.WantTx = true
return nil
Expand Down
2 changes: 1 addition & 1 deletion kernel/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (chain *Chain) checkRoundMature(round uint64) (uint64, bool) {
}

func (chain *Chain) writeRoundWork(round uint64, works []*common.SnapshotWork, credit bool) error {
credit = credit || (chain.node.IdForNetwork.String() == config.KernelNetworkId &&
credit = credit || (chain.node.networkId.String() == config.KernelNetworkId &&
(works[0].Timestamp-chain.node.Epoch)/OneDay < mainnetMintDayGapSkipForkBatch)
for chain.running {
err := chain.persistStore.WriteRoundWork(chain.ChainId, round, works, credit)
Expand Down
2 changes: 1 addition & 1 deletion kernel/self.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (node *Node) validateKernelSnapshot(s *common.Snapshot, tx *common.Versione
switch tx.TransactionType() {
case common.TransactionTypeMint:
if finalized && tx.Inputs[0].Mint.Batch < mainnetMintDayGapSkipForkBatch &&
node.IdForNetwork.String() == config.KernelNetworkId {
node.networkId.String() == config.KernelNetworkId {
return nil
}
err := node.validateMintSnapshot(s, tx)
Expand Down

0 comments on commit f49015b

Please sign in to comment.