Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed May 17, 2024
1 parent 17a827c commit 6a6e1b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/shareProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var ShareProcessor = module.exports = function ShareProcessor(config, logger){

var transactions = block.transactions;
var coinbaseTx = transactions[transactions.length - 1];
var index = block.ghostUncles.findIndex((u) => u.hash === ghostUncleHash)
var index = block.ghostUncles.findIndex((u) => u.blockHash === ghostUncleHash)
var rewardOutput = coinbaseTx.unsigned.fixedOutputs[index + 1];
var rewardAmount = rewardOutput.attoAlphAmount;
logger.info('Found main chain block ' + block.hash + ', uncle reward: ' + rewardAmount);
Expand Down
2 changes: 1 addition & 1 deletion test/shareProcessorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('test share processor', function(){
var ghostUncleBlock = {hash: 'block1', height: 1, chainFrom: 0, chainTo: 0, transactions: ghostUncleCoinbaseTx, inMainChain: false, submittedMs: currentMs, ghostUncles: []}

var mainChainCoinbaseTx = [{unsigned:{fixedOutputs:[{attoAlphAmount: rewardAmount},{attoAlphAmount: ghostUncleRewardAmount}]}}];
var mainChainBlock = {hash: 'block2', height: 2, chainFrom: 0, chainTo: 0, transactions: mainChainCoinbaseTx, inMainChain: true, submittedMs: currentMs, ghostUncles: [{hash:ghostUncleBlock.hash}]}
var mainChainBlock = {hash: 'block2', height: 2, chainFrom: 0, chainTo: 0, transactions: mainChainCoinbaseTx, inMainChain: true, submittedMs: currentMs, ghostUncles: [{blockHash:ghostUncleBlock.hash}]}
var blocks = [ghostUncleBlock, mainChainBlock]

function prepare(blocks, callback){
Expand Down

0 comments on commit 6a6e1b6

Please sign in to comment.