Merged-Mining

如何刪除我的 Devcoin 複製中的慈善功能?

  • November 8, 2014

我正在嘗試生產與比特幣合併開采的 SHA256 山寨幣。我想使用一些最近的程式碼,而不是基於 0.8.* 或更早的程式碼庫。我找到了這個來源: https ://github.com/sidhujag/bitcoin-0.9.2-Merge-Mining-fork

但是,它基於 Devcoin,因此它將一些挖礦收益發送給其他方。我發現在保持合併探勘的同時提取此功能非常困難。例如,在 miner.cpp 文件中,我修改了 CreateNewBlock 函式以刪除“準備支付受益人”部分,但是當我這樣做時,編譯的程式碼會出現段錯誤。

感謝任何可以提供幫助的人。

編輯:我已經用 GDB 執行了節點,這是錯誤和回溯:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd49e4700 (LWP 2385)]
0x000055555562ca50 in CreateNewBlock (scriptPubKeyIn=...)
   at miner.cpp:375
375         pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);

(gdb) backtrace
#0  0x000055555562ca50 in CreateNewBlock (scriptPubKeyIn=...)
   at miner.cpp:375
#1  0x000055555562dc4f in CreateNewBlockWithKey (reservekey=...)
   at miner.cpp:513
#2  0x000055555562de51 in GreedycoinMiner (pwallet=
   0x555556502c70) at miner.cpp:597
#3  0x00007ffff7547a4a in boost::(anonymous namespace)::thread_proxy (param=<optimized out>)
   at libs/thread/src/pthread/thread.cpp:164
#4  0x00007ffff5cc2182 in start_thread (arg=0x7fffd49e4700)
   at pthread_create.c:312
#5  0x00007ffff59ef30d in clone ()
   at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
int64_t nFees = 0;
int64_t minerValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
int64_t sharePerAddress = 0;
if (coinAddressStrings.size() == 0)
   minerValue -= fallbackReduction;
else
   sharePerAddress = roundint64((int64_t)share / (int64_t)coinAddressStrings.size());

LogPrintf("coinAddressStrings: %d\n", coinAddressStrings.size());
for (unsigned int i=0; i<coinAddressStrings.size(); i++)
{

這是 miner.cpp 中的程式碼。我認為您應該嘗試更改以下行:

sharePerAddress = roundint64((int64_t)share / (int64_t)coinAddressStrings.size());

將其更改為

sharePerAddress = 0;

這應該消除對受益人的任何付款。

引用自:https://bitcoin.stackexchange.com/questions/32346