mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
Separated COINBASE_FLAGS out into main.h and made RPC getmemorypool return it
This commit is contained in:
parent
9e8818ec9d
commit
52a3d2635c
@ -1871,6 +1871,7 @@ Value getmemorypool(const Array& params, bool fHelp)
|
|||||||
" \"previousblockhash\" : hash of current highest block\n"
|
" \"previousblockhash\" : hash of current highest block\n"
|
||||||
" \"transactions\" : contents of non-coinbase transactions that should be included in the next block\n"
|
" \"transactions\" : contents of non-coinbase transactions that should be included in the next block\n"
|
||||||
" \"coinbasevalue\" : maximum allowable input to coinbase transaction, including the generation award and transaction fees\n"
|
" \"coinbasevalue\" : maximum allowable input to coinbase transaction, including the generation award and transaction fees\n"
|
||||||
|
" \"coinbaseflags\" : data that should be included in coinbase so support for new features can be judged\n"
|
||||||
" \"time\" : timestamp appropriate for next block\n"
|
" \"time\" : timestamp appropriate for next block\n"
|
||||||
" \"bits\" : compressed target of next block\n"
|
" \"bits\" : compressed target of next block\n"
|
||||||
"If [data] is specified, tries to solve the block and returns true if it was successful.");
|
"If [data] is specified, tries to solve the block and returns true if it was successful.");
|
||||||
@ -1925,6 +1926,7 @@ Value getmemorypool(const Array& params, bool fHelp)
|
|||||||
result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex()));
|
result.push_back(Pair("previousblockhash", pblock->hashPrevBlock.GetHex()));
|
||||||
result.push_back(Pair("transactions", transactions));
|
result.push_back(Pair("transactions", transactions));
|
||||||
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
|
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
|
||||||
|
result.push_back(Pair("coinbaseflags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end())));
|
||||||
result.push_back(Pair("time", (int64_t)pblock->nTime));
|
result.push_back(Pair("time", (int64_t)pblock->nTime));
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
@ -3130,12 +3130,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
|
|||||||
hashPrevBlock = pblock->hashPrevBlock;
|
hashPrevBlock = pblock->hashPrevBlock;
|
||||||
}
|
}
|
||||||
++nExtraNonce;
|
++nExtraNonce;
|
||||||
pblock->vtx[0].vin[0].scriptSig = CScript() << pblock->nTime << CBigNum(nExtraNonce);
|
pblock->vtx[0].vin[0].scriptSig = (CScript() << pblock->nTime << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
|
||||||
|
|
||||||
// Put "/P2SH/" in the coinbase so everybody can tell when
|
|
||||||
// a majority of miners support it
|
|
||||||
const char* pszP2SH = "/P2SH/";
|
|
||||||
pblock->vtx[0].vin[0].scriptSig += CScript() << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
|
|
||||||
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
|
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
|
||||||
|
|
||||||
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
|
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
|
||||||
|
@ -49,6 +49,12 @@ static const int fHaveUPnP = false;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Put "/P2SH/" in the coinbase so everybody can tell when
|
||||||
|
// a majority of miners support it
|
||||||
|
static const char* pszP2SH = "/P2SH/";
|
||||||
|
static const CScript COINBASE_FLAGS = CScript() << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user