make coinbase normal tx
This commit is contained in:
@@ -673,8 +673,8 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
uint256 txHash = tx.GetHash();
|
uint256 txHash = tx.GetHash();
|
||||||
setTxIndex[txHash] = i++;
|
setTxIndex[txHash] = i++;
|
||||||
|
|
||||||
if (tx.IsCoinBase() && !coinbasetxn)
|
//if (tx.IsCoinBase() && !coinbasetxn)
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
UniValue entry(UniValue::VOBJ);
|
UniValue entry(UniValue::VOBJ);
|
||||||
|
|
||||||
@@ -694,17 +694,17 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template]));
|
entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template]));
|
||||||
entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template]));
|
entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template]));
|
||||||
|
|
||||||
if (tx.IsCoinBase()) {
|
//if (tx.IsCoinBase()) {
|
||||||
// Show founders' reward if it is required
|
// Show founders' reward if it is required
|
||||||
//if (pblock->vtx[0].vout.size() > 1) {
|
//if (pblock->vtx[0].vout.size() > 1) {
|
||||||
// Correct this if GetBlockTemplate changes the order
|
// Correct this if GetBlockTemplate changes the order
|
||||||
// entry.push_back(Pair("foundersreward", (int64_t)tx.vout[1].nValue));
|
// entry.push_back(Pair("foundersreward", (int64_t)tx.vout[1].nValue));
|
||||||
//}
|
//}
|
||||||
CAmount nReward = GetBlockSubsidy(chainActive.LastTip()->nHeight+1, Params().GetConsensus());
|
// CAmount nReward = GetBlockSubsidy(chainActive.LastTip()->nHeight+1, Params().GetConsensus());
|
||||||
entry.push_back(Pair("coinbasevalue", nReward));
|
// entry.push_back(Pair("coinbasevalue", nReward));
|
||||||
entry.push_back(Pair("required", true));
|
// entry.push_back(Pair("required", true));
|
||||||
txCoinbase = entry;
|
// txCoinbase = entry;
|
||||||
} else
|
// } else
|
||||||
transactions.push_back(entry);
|
transactions.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -726,13 +726,13 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
result.push_back(Pair("version", pblock->nVersion));
|
result.push_back(Pair("version", pblock->nVersion));
|
||||||
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));
|
||||||
if (coinbasetxn) {
|
//if (coinbasetxn) {
|
||||||
assert(txCoinbase.isObject());
|
// assert(txCoinbase.isObject());
|
||||||
result.push_back(Pair("coinbasetxn", txCoinbase));
|
// result.push_back(Pair("coinbasetxn", txCoinbase));
|
||||||
} else {
|
//} else {
|
||||||
result.push_back(Pair("coinbaseaux", aux));
|
// result.push_back(Pair("coinbaseaux", aux));
|
||||||
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("longpollid", chainActive.LastTip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast)));
|
result.push_back(Pair("longpollid", chainActive.LastTip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast)));
|
||||||
if ( ASSETCHAINS_STAKED != 0 )
|
if ( ASSETCHAINS_STAKED != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user