Skip to content

Commit

Permalink
for external mining (p2/pools)
Browse files Browse the repository at this point in the history
  • Loading branch information
neiros committed Jun 30, 2018
1 parent 3dc4b93 commit aa18110
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 217 // 99
#define CLIENT_VERSION_BUILD 6
#define CLIENT_VERSION_BUILD 7

// Set to true for release, false for prerelease or test build Установите true для релиза, false для предварительной или тестовой сборки
#define CLIENT_VERSION_IS_RELEASE true // false
Expand Down
1 change: 1 addition & 0 deletions src/main.h
Expand Up @@ -1386,6 +1386,7 @@ struct CBlockTemplate
std::vector<int64_t> vTxFees;
std::vector<int64_t> vTxSigOps;
CBigNum sumTrDif;
std::vector<CTxOut> vBackWhither; // сколько куда
};


Expand Down
2 changes: 2 additions & 0 deletions src/miner.cpp
Expand Up @@ -503,6 +503,8 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
{
pblock->vtx[0].vout.push_back(CTxOut(ret, vecTxHashPriority[cp].get<1>().scriptPubKey));
NewCoin -= ret;

pblocktemplate->vBackWhither.push_back(CTxOut(ret, vecTxHashPriority[cp].get<1>().scriptPubKey)); // сколько куда
}
}
else
Expand Down
13 changes: 13 additions & 0 deletions src/rpcmining.cpp
Expand Up @@ -704,6 +704,19 @@ Value getblocktemplate(const Array& params, bool fHelp)
result.push_back(Pair("bits", HexBits(pblock->nBits)));
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));

Array FeeBack;
for (unsigned int i = 0; pblocktemplate->vBackWhither.size() > i; i++)
{
Object entry;

CDataStream TxOut(SER_NETWORK, PROTOCOL_VERSION);
TxOut << pblocktemplate->vBackWhither[i];

entry.push_back(Pair("BackWhither", HexStr(TxOut.begin(), TxOut.end())));
FeeBack.push_back(entry);
}
result.push_back(Pair("FeeBack", FeeBack));

return result;
}

Expand Down

0 comments on commit aa18110

Please sign in to comment.