Author

Topic: null (Read 715 times)

hero member
Activity: 574
Merit: 523
May 04, 2014, 02:04:53 PM
#7

I changed some of the difficulty parameters around (like you said) and got it mining. Subsidy was = to 0 and not 1.

However now my custom difficulty algorithm isn't the same. I'm trying to have the block reward reduced by 0.00005 every block. But this code obviously didn't work.

Code:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
    int64 nSubsidy = 50 * COIN - (nHeight * COIN / 20000);

    // Subsidy is reduced by 0.00005 every block
    nSubsidy >>= (nHeight / 0);

    return nSubsidy + nFees;
}

Quote
nSubsidy >>= (nHeight / 0);

what is the result of division by zero? Wink

I was hoping that subsidy would never half. So the payout decreases by 0.00005 consistently until it reaches 0 after 1,000,001 blocks. Thus removing the need for a halving rate.

The division by zero has undefined result in mathematics and causes exception or abnormal termination in most implementations of computer languages. The hope is a thing for soul and faith.
If you like to remove halving then you need to remove the complete statement, not just set the divisor to zero.
hero member
Activity: 574
Merit: 523
May 04, 2014, 11:55:41 AM
#6

I changed some of the difficulty parameters around (like you said) and got it mining. Subsidy was = to 0 and not 1.

However now my custom difficulty algorithm isn't the same. I'm trying to have the block reward reduced by 0.00005 every block. But this code obviously didn't work.

Code:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
    int64 nSubsidy = 50 * COIN - (nHeight * COIN / 20000);

    // Subsidy is reduced by 0.00005 every block
    nSubsidy >>= (nHeight / 0);

    return nSubsidy + nFees;
}

Quote
nSubsidy >>= (nHeight / 0);

what is the result of division by zero? Wink
hero member
Activity: 574
Merit: 523
May 04, 2014, 09:33:04 AM
#5
Connect it with the other daemon and retry the command, please

Ok, I now have 2 Ubuntu Linux machines running a freshly compiled daemon. One is a virtual machine, the other is a laptop.

The laptop is running ./litecoind &
The virtual machine is running ./litecoind -connect=192.168.40.3 &


Both daemon's give this:

Code:
hi@UbuntuVM1:~/Desktop/lz/src$ ./litecoind getblocktemplate '{"mode":"template"}'
error: {"code":-10,"message":"Litecoin is downloading blocks..."}
hi@UbuntuVM1:~/Desktop/lz/src$

Then recreate the genesis block with the updated creation time, so its time within the same 24h period as current time.
Then retry getblocktemplate call and setgenerate in this order.
If getblocktemplate succeeds but the setgenerate fails then try to find a block with external miner like minerd or cgminer.
If both methods (setgenerate and mining with external mining) fails then most likely some parameters that control the new difficulty calculation are improperly selected.


hero member
Activity: 574
Merit: 523
May 03, 2014, 09:57:21 PM
#4
Try to issue the getblocktemplate command without setting setgenerate:

Code:
litecoind getblocktemplate
or
Code:
litecoind getblocktemplate '{"mode":"template"}'
if the first variant doesn't work.

What happens?

QT: Litecoin is downloading blocks... (code -10)
Daemon: hi@UbuntuVM1:~/Desktop/lz/src$ error:{"code":-10,"message":"Litecoin is downloading blocks..."}

Connect it with the other daemon and retry the command, please
hero member
Activity: 574
Merit: 523
May 03, 2014, 09:49:57 PM
#3
Try to issue the getblocktemplate command without setting setgenerate:

Code:
litecoind getblocktemplate
or
Code:
litecoind getblocktemplate '{"mode":"template"}'
if the first variant doesn't work.

What happens?
member
Activity: 109
Merit: 35
May 03, 2014, 01:02:29 PM
#2
You mentioned the Qt crashing.

You would be best to run things from the daemon at this stage as Qt wallets do have a habit of crashing when running RPC commands if the compiler flags aren't spot-on. This seems most prevalent in Windows but can happen in Linux. Just compile the daemon only and try to see what happens when you mine with that.
newbie
Activity: 6
Merit: 0
April 30, 2014, 05:40:19 PM
#1
null
Jump to: