some bugs fixed, add alph node method

This commit is contained in:
lzx
2025-04-11 19:59:58 +08:00
parent 2d8675368f
commit 9fe4d9145a
4 changed files with 34 additions and 10 deletions

View File

@@ -481,12 +481,18 @@ class ALPHRPCNode extends HttpNode {
const coinbaseTx = transactions[transactions.length - 1].unsigned
if (coinbaseTx.inputs.length === 0) {
const {fixedOutputs} = coinbaseTx
if(fixedOutputs.length === 1){
const {attoAlphAmount, address } = fixedOutputs[0]
for(let item of fixedOutputs){
const {attoAlphAmount, address } = item
if(address === REPORT_ADDRESS){
return {height, hash: block_hash, time:Math.trunc(timestamp / 1000), block_reward: Number(attoAlphAmount), block_fees: null };
}
}
// if(fixedOutputs.length === 1){
// const {attoAlphAmount, address } = fixedOutputs[0]
// if(address === REPORT_ADDRESS){
// return {height, hash: block_hash, time:Math.trunc(timestamp / 1000), block_reward: Number(attoAlphAmount), block_fees: null };
// }
// }
}
return false
} catch(err){