Skip to content

Commit

Permalink
update masternode
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Nov 8, 2023
1 parent c1c078a commit bbd38d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ protected virtual byte[] BuildRawTransactionBuffer()

protected virtual Money CreateMasternodeOutputs(Transaction tx, Money reward)
{
if(masterNodeParameters.Masternode != null)
if(masterNodeParameters.Masternode != null && masterNodeParameters.MasternodePaymentsStarted && masterNodeParameters.MasternodePaymentsEnforced)
{
Masternode[] masternodes;

Expand All @@ -485,12 +485,12 @@ protected virtual Money CreateMasternodeOutputs(Transaction tx, Money reward)
{
foreach(var masterNode in masternodes)
{
if(!string.IsNullOrEmpty(masterNode.Payee))
if(!string.IsNullOrEmpty(masterNode.Script))
{
var payeeDestination = BitcoinUtils.AddressToDestination(masterNode.Payee, network);
Script payeeAddress = new (masterNode.Script.HexToByteArray());
var payeeReward = masterNode.Amount;

tx.Outputs.Add(payeeReward, payeeDestination);
tx.Outputs.Add(payeeReward, payeeAddress);
reward -= payeeReward;
}
}
Expand Down

0 comments on commit bbd38d5

Please sign in to comment.