Ycash support (#46)
This commit is contained in:
parent
e4d82751ab
commit
d2635ca369
|
@ -208,6 +208,24 @@ exports.createGeneration = (rpcData, blockReward, feeReward, recipients, poolAdd
|
|||
);
|
||||
});
|
||||
}
|
||||
} else if(Array.isArray(coin.vYcashFoundersRewardAddress)) {
|
||||
// Founders reward for Ycash
|
||||
let foundersAddrHash = bitcoin.address.fromBase58Check(rpcData.coinbasetxn.foundersaddress).hash
|
||||
|
||||
// console.log(`foundersIndex: ${index}`)
|
||||
// console.log(`foundersAddr: ${coin.vYcashFoundersRewardAddress[index]}`)
|
||||
|
||||
// pool t-addr
|
||||
txb.addOutput(
|
||||
scriptCompile(poolAddrHash),
|
||||
Math.round(blockReward.total * (1 - (coin.percentFoundersReward + feePercent) / 100)) + feeReward
|
||||
);
|
||||
|
||||
// founders t-addr
|
||||
txb.addOutput(
|
||||
scriptCompile(foundersAddrHash),
|
||||
Math.round(blockReward.total * (coin.percentFoundersReward / 100))
|
||||
)
|
||||
} else {
|
||||
// founders reward
|
||||
let index = parseInt(Math.floor(rpcData.height / coin.foundersRewardAddressChangeInterval))
|
||||
|
@ -460,4 +478,3 @@ module.exports.getFees = feeArray => {
|
|||
feeArray.forEach(value => fee += Number(value.fee))
|
||||
return fee
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue