Author

Topic: need help !! (Read 278 times)

member
Activity: 69
Merit: 10
Blockchain the future of democratic payment!
September 27, 2017, 08:57:20 AM
#6
if (nHeight > 900) return 0;

This should work? Did it work?

newbie
Activity: 18
Merit: 0
September 27, 2017, 06:51:32 AM
#5
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
  nSubsidy = (nHeight == 1) ?
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)

i want 10000coins  in the first block and he rest blocks should have 100 coins each  considering the simple liteocin source i guess mine is right but still need some expert advice


Since you only want 100000 coins total, you need to stop rewarding coin after 1000 blocks minus the first premined. So 900 blocks. (900*100 + 10000 = 100000).

Just add at the beginning :

Code:
if (nHeight > 900) return 0;

Not sure what your problem is? This is very simple
Just pmed you
newbie
Activity: 29
Merit: 0
September 27, 2017, 06:29:14 AM
#4
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
  nSubsidy = (nHeight == 1) ?
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)

i want 10000coins  in the first block and he rest blocks should have 100 coins each  considering the simple liteocin source i guess mine is right but still need some expert advice


Since you only want 100000 coins total, you need to stop rewarding coin after 1000 blocks minus the first premined. So 900 blocks. (900*100 + 10000 = 100000).

Just add at the beginning :

Code:
if (nHeight > 900) return 0;

Not sure what your problem is? This is very simple
newbie
Activity: 18
Merit: 0
September 27, 2017, 06:27:55 AM
#3
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
  nSubsidy = (nHeight == 1) ?
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)

i want 10000coins  in the first block and he rest blocks should have 100 coins each  considering the simple liteocin source i guess mine is right but still need some expert advice
newbie
Activity: 29
Merit: 0
September 27, 2017, 06:15:46 AM
#2
I guess you're refering to GetBlockSubsidy() function.

nSubsidy is the number of coin "mined".
nHeight is the block number.

Here you're just telling the function to reward "10000" coins for the first block (provided that you're returning this value).

Given what you asked, a more comprehensible way to achieve the same result would be :

Code:
  nSubsidy = (nHeight == 1) ?
                      10000 * COIN :
                      100 * COIN;

Also, not sure, but the first block is probably 0 (nHeight)
newbie
Activity: 18
Merit: 0
September 27, 2017, 05:18:16 AM
#1
Iam cloning a coin (basic script)  so i can explore crypto programming need a little help.

I want to code 100000coin
premine 10000 coin and then 100 coins per block. how to do this

{
    int64 nSubsidy = 100 * COIN;

    if(nHeight == 1) 
     {
         nSubsidy = 10000 * COIN;
     }




is this correct Huh?
Jump to: