Esempio n. 1
0
 protected virtual Money CreateFounderOutputs(Transaction tx, Money reward)
 {
     if (FounderParameters.Founder != null)
     {
         Founder[] founders = new[] { FounderParameters.Founder.ToObject <Founder>() };
         foreach (var Founder in founders)
         {
             if (!string.IsNullOrEmpty(Founder.Payee))
             {
                 var payeeAddress = coin.IsFounderPayeeMultisig ? BitcoinUtils.MultiSigAddressToDestination(Founder.Payee, network) : BitcoinUtils.AddressToDestination(Founder.Payee, network);
                 var payeeReward  = Founder.Amount;
                 reward       -= payeeReward;
                 rewardToPool -= payeeReward;
                 tx.Outputs.Add(payeeReward, payeeAddress);
             }
         }
     }
     return(reward);
 }
Esempio n. 2
0
        protected virtual Money CreateTreasuryOutputs(Transaction tx, Money reward)
        {
            if (TreasuryParameters.Treasury != null)
            {
                Treasury[] treasurys = new[] { TreasuryParameters.Treasury.ToObject <Treasury>() };
                foreach (var Treasury in treasurys)
                {
                    if (!string.IsNullOrEmpty(Treasury.Address))
                    {
                        var payeeAddress = coin.IsTreasuryAddressMultisig ? BitcoinUtils.MultiSigAddressToDestination(Treasury.Address, network) : BitcoinUtils.AddressToDestination(Treasury.Address, network);
                        var payeeReward  = Treasury.Amount;

                        reward       -= payeeReward;
                        rewardToPool -= payeeReward;

                        tx.Outputs.Add(payeeReward, payeeAddress);
                    }
                }
            }
            return(reward);
        }