Show Posts
|
|
Pages: [1] 2 3 »
|
|
Hello. I'm asked on the different forums but no answer. Maybe here?
There in cgminer(based on cpuminer) exist such code:
static uint8_t diff_to_bits(double diff) { uint64_t diff64; uint8_t i;
diff /= 0.9999847412109375; diff *= (double)2147483648.0; if (diff > 0x8000000000000000ULL) diff = 0x8000000000000000ULL; /* Convert it to an integer */ diff64 = diff; for (i = 0; diff64; i++, diff64 >>= 1);
return i; }
static double bits_to_diff(uint8_t bits) { double ret = 1.0;
if (likely(bits > 32)) ret *= 1ull << (bits - 32); else if (unlikely(bits < 32)) ret /= 1ull << (32 - bits); return ret; }
How to adapt this code for scrypt to calculate diff to bits and vice versa?
Thanks!
|
|
|
|
|
Hello there! For bitcoin: difficulty = first_block_target / current_target Is it correct for LTC? If not - how to calculate it?
More For BTC (first block bits=0x1d00ffff) target= 0x00000000ffff0000000000000000000000000000000000000000000000000000
for LTC if follow same way (first block bits=0x1e0ffff0) target= 0x00000ffff0000000000000000000000000000000000000000000000000000000
That's true?
Also there in cgminer presents such code (from BTC asic driver):
static uint8_t diff_to_bits(double diff) { uint64_t diff64; uint8_t i;
diff /= 0.9999847412109375; diff *= (double)2147483648.0; if (diff > 0x8000000000000000ULL) diff = 0x8000000000000000ULL; /* Convert it to an integer */ diff64 = diff; for (i = 0; diff64; i++, diff64 >>= 1);
return i; }
static double bits_to_diff(uint8_t bits) { double ret = 1.0;
if (likely(bits > 32)) ret *= 1ull << (bits - 32); else if (unlikely(bits < 32)) ret /= 1ull << (32 - bits); return ret; } I think that need to alter this line for LTC: diff *= (double)2147483648.0; but how?
So how to adapt this code for LTC?
I'm trying to ask on different forums but no answer. Somebody please help. Thanks!
|
|
|
|
|
Но ведь в лайте сложность считается по другому. в цгмайнере ведь:
d64 = truediffone; if (opt_scrypt) d64 *= (double)65536; d64 /= diff;
Если сделать так, будет работать?
static uint8_t diff_to_bits(double diff) { // uint64_t diff64; uint64_t diff64 = 0x0000ffff00000000ULL; //Для BTC: 0x00000000ffff00000000ULL uint8_t i;
diff /= 0.9999847412109375; diff *= (double)2147483648.0; if (diff > 0x8000000000000000ULL) diff = 0x8000000000000000ULL; /* Convert it to an integer */ diff64 = diff; for (i = 0; diff64; i++, diff64 >>= 1);
return i; }
|
|
|
|
|
Для лайта d64 *= (double)65536;
Никак не пойму, как пересчитать.
Помогите с кодом. Хотел послать Bам мессичж, но не получается.
[2020-09-24 14:46:06] Selecting pool 0 for work [2020-09-24 14:46:06] Generated stratum merkle e24c2e8aaf286268c10ab2ab2c665c8e608d4540a1f6ddd5c4b3a1b19db0edd8 [2020-09-24 14:46:06] Generated stratum header 2000000082d707057d13915213d93665a76946b6f0d3015d535f440afb8a83eacc620f61e24c2e8[43;1Haaf286268c10ab2ab2c665c8e608d4540a1f6ddd5c4b3a1b19db0edd85f6c86eb1a01b1980000 00000000008000000000000000000000000000000000000000[44;1H000000000000000000 [2020-09-24 14:46:06] Work job_id L9DEwtsDy nonce2 39 ntime 5f6c86eb [2020-09-24 14:46:06] Generated target 0000000000000000000000000000000000000000000000000080ff7f00000000 [2020-09-24 14:46:06] Generated stratum work [2020-09-24 14:46:06] Pushing work from pool 0 to hash queue [12d[4M[45d [2020-09-24 14:46:06] CTA0: CTARead (amt=128 err=-7 ern=110) [2020-09-24 14:46:06] USB: CTA0 read1 buffering 64 extra bytes [2020-09-24 14:46:06] CTA0: invalid nonce
|
|
|
|
Да, всё кроме этого,поменял, но неправильно считает нонс,98% reject 
|
|
|
|
|
Помогите пожалуйста.
Как преобразовать этот код для лайткоинa?
Для биткоина это выглядит так:
static uint8_t diff_to_bits(double diff) { uint64_t diff64; uint8_t i;
diff /= 0.9999847412109375; diff *= (double)2147483648.0; if (diff > 0x8000000000000000ULL) diff = 0x8000000000000000ULL; /* Convert it to an integer */ diff64 = diff; for (i = 0; diff64; i++, diff64 >>= 1);
return i; }
static double bits_to_diff(uint8_t bits) { double ret = 1.0;
if (likely(bits > 32)) ret *= 1ull << (bits - 32); else if (unlikely(bits < 32)) ret /= 1ull << (32 - bits); applog(LOG_INFO, "ret=\n",ret);
return ret; }
Спасибо!
|
|
|
|
|
@kassex
Послал Вам 1 MTNC,проверьте. TxID be8f778ea46589786634b3bc6e451d6c5568f388ca2487846abab343c0835c57
edit.
У меня в клиенте только сейчас подтверждаются транзакции от 14 15 числа. Думаю, что, как только все перейдут на цепочку от дева, всё будет в порядке. Кстати, несколько раз перегружал клиента и делал repairwallet. Сейчас у меня всё OK. P.S. Fucki*g recaptcha.
|
|
|
|
Guys! I think that you have to say many thanks to @ideaupdater. First of all he react very fast coz new checkpoints and right blockchain on github commit were updated very fast- in 17 hours!!! Some coins do that things in weeks  I'm also coder and have my very own coin and I can understand all the problems too. So thank You @ideaupdater for your work. Regards.
|
|
|
|
I was checking cryptopia - no coins in my account  Looks like cryptopia for now in a wrong chain.
|
|
|
|
Yep, same chain. Last thing check if cryptopia there too 
|
|
|
|
|
No, I was sending to cryptopia and can say that my transaction appears on explorer so it's right chain Will check after 30 confirmations if funds arrived there.
Post your wallet here and I will send you 1 coins to check too. Or PM me with wallet. We need first of all check chain.
|
|
|
|
|
We are on the same chain. OK will try to send some to cryptopia
|
|
|
|
|
@kassex Can you check chain too? Please past hash of any block. I want to compare.
|
|
|
|
|
@forexhercules Can you please enter from debug console getblockhash 578571
end past hash here? If it's equal my previous post likely we are at right chain.
@kassex type from console repairwallet after reboot
|
|
|
|
I was compiling latest wallet from github with new checkpoints: https://github.com/masternodecoin/masternodecoin/commit/f4e19a404643c36bf7df5c15768e8f2b4b432e9falso using latest blockchain: https://mega.nz/#F!BThmTQQS!sXY7k6-eERbpi_9fUJdpVg Synchronized and staking too but if try to send some to cryptopia coins didn't arrived. Maybe cryptopia at wrong chain or what? BTW can someone check chain? 18:32:51  getblockcount 18:32:51  578571 18:33:21 getblockhash 578571 18:33:21  d8ce204efe03c9657ef03938899c3a90abccb5cd8faaf5948d94c3840a189fbe On explorer I seen another hash  e5bf51148b5c5b3a5a1447db370b2626e315569202f94508234d4112132db047
|
|
|
|
@ideaupdater Can you please upload right chain? Definitely can't synchronize  Thanks.
|
|
|
|
Nice announcment on discord: https://discordapp.com/channels/443418682702430209/445847193123946497@everyone WARNING: Do not download the wallet of the new coin: Social Traders. It has malicious code that will steal private keys and funds from other wallets on the same machine, including PIVX, LPC, and LGS wallets. An entire shared MN hosting service (Bcard) and individual investors in our community with the social trader's wallet on their machines have been compromised and had their digital assets stolen!
|
|
|
|
|
@nxtZen Masternodecoin- очень хорошая монетка. Тоже есть 2 ноды, брал по 0.6 BTC. Тоже давно окупились. Осенью 100% поднимется.
|
|
|
|
|