|
49 | 49 | using interfaces::BlockTemplate; |
50 | 50 | using interfaces::Mining; |
51 | 51 | using node::BlockAssembler; |
| 52 | +using node::GetMinimumTime; |
52 | 53 | using node::NodeContext; |
53 | 54 | using node::RegenerateCommitments; |
54 | 55 | using node::UpdateTime; |
@@ -674,7 +675,7 @@ static RPCHelpMan getblocktemplate() |
674 | 675 | {RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"}, |
675 | 676 | {RPCResult::Type::STR, "longpollid", "an id to include with a request to longpoll on an update to this template"}, |
676 | 677 | {RPCResult::Type::STR, "target", "The hash target"}, |
677 | | - {RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME}, |
| 678 | + {RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME + ". Adjusted for the proposed BIP94 timewarp rule."}, |
678 | 679 | {RPCResult::Type::ARR, "mutable", "list of ways the block template may be changed", |
679 | 680 | { |
680 | 681 | {RPCResult::Type::STR, "value", "A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'"}, |
@@ -977,7 +978,7 @@ static RPCHelpMan getblocktemplate() |
977 | 978 | result.pushKV("coinbasevalue", (int64_t)block.vtx[0]->vout[0].nValue); |
978 | 979 | result.pushKV("longpollid", tip.GetHex() + ToString(nTransactionsUpdatedLast)); |
979 | 980 | result.pushKV("target", hashTarget.GetHex()); |
980 | | - result.pushKV("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1); |
| 981 | + result.pushKV("mintime", GetMinimumTime(pindexPrev, consensusParams.DifficultyAdjustmentInterval())); |
981 | 982 | result.pushKV("mutable", std::move(aMutable)); |
982 | 983 | result.pushKV("noncerange", "00000000ffffffff"); |
983 | 984 | int64_t nSigOpLimit = MAX_BLOCK_SIGOPS_COST; |
|
0 commit comments