Ycash support (#46)

This commit is contained in:
Potato 2019-07-17 03:23:33 +02:00 committed by Beshoy Girgis
parent e4d82751ab
commit d2635ca369
1 changed files with 18 additions and 1 deletions

View File

@ -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
}