Skip to content

Commit

Permalink
delay getBlockSigners
Browse files Browse the repository at this point in the history
  • Loading branch information
bobcoin98 committed Oct 17, 2023
1 parent ee40ff2 commit 696c4bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"foundationRewardRate": 10,
"gas": 2000000,
"blockSignerGap": 15,
"blockSignerDelay": 5,
"foundationAddress": "0x0000000000000000000000000000000000000068",
"validatorAddress": "0x0000000000000000000000000000000000000088",
"blockSignerAddress": "0x0000000000000000000000000000000000000089",
Expand Down
4 changes: 2 additions & 2 deletions crawl.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ const getBlockSigners = async (number) => {

async function updateLatestSignedBlock (blk) {
try {
if (!blk || blk.number % parseInt(config.get('blockchain.blockSignerGap')) != 0) {
if (!blk || blk.number % parseInt(config.get('blockchain.blockSignerGap')) != parseInt(config.get('blockchain.blockSignerDelay'))) {
return
}
const signers = await getBlockSigners(blk.number)
const signers = await getBlockSigners(blk.number - parseInt(config.get('blockchain.blockSignerDelay')))
let bulkOps = []
for (const signer of signers) {
bulkOps.push({
Expand Down

0 comments on commit 696c4bc

Please sign in to comment.