Commit 992f37f
committed
Merge bitcoin/bitcoin#31600: rpc: have getblocktemplate mintime account for timewarp
e1676b0 doc: release notes (Sjors Provoost)
0082f6a rpc: have mintime account for timewarp rule (Sjors Provoost)
79d45b1 rpc: clarify BIP94 behavior for curtime (Sjors Provoost)
0713548 refactor: add GetMinimumTime() helper (Sjors Provoost)
Pull request description:
#30681 fixed the `curtime` field of `getblocktemplate` to take the timewarp rule into account. However I forgot to do the same for the `mintime` field, which was hardcoded to use `pindexPrev->GetMedianTimePast()+1`.
This PR adds a helper `GetMinimumTime()` and uses it for the `mintime` field.
#31376 changed the `curtime` field to always account for the timewarp rule. This PR maintains that behavior.
Note that `mintime` now always applies BIP94, including on mainnet. This makes future softfork activation safer.
It could be backported to v28.
ACKs for top commit:
fjahr:
tACK e1676b0
achow101:
ACK e1676b0
darosior:
utACK e1676b0 on the code changes
tdb3:
brief code review re ACK e1676b0
TheCharlatan:
ACK e1676b0
Tree-SHA512: 0e322d8cc3b8ff770849bce211edcb5b6f55d04e5e0dee0657805049663d758f27423b047ee6363bd8f6c6fead13f974760f48b3321ea86f514f446e1b23231cFile tree
5 files changed
+39
-9
lines changed- doc
- src
- node
- rpc
- test/functional
5 files changed
+39
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
674 | 675 | | |
675 | 676 | | |
676 | 677 | | |
677 | | - | |
| 678 | + | |
678 | 679 | | |
679 | 680 | | |
680 | 681 | | |
| |||
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | | - | |
| 687 | + | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
| |||
977 | 978 | | |
978 | 979 | | |
979 | 980 | | |
980 | | - | |
| 981 | + | |
981 | 982 | | |
982 | 983 | | |
983 | 984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
0 commit comments