Commit ef92709
committed
Fix amount whole bitcoin constructors
I royally botched the recent effort to make const amount constructors
use a smaller type. I left in an unnecessary panic and forgot to do
both of them.
Note these function return values will change again very shortly when we
start enforcing the MAX_MONEY invariant. However the 64 to 32 bit change
is unrelated to that and is easier to review if done separately.
Whole bitcoin can non in any sane environment be greater than 21,000,000
which fits in 32 bits so we can take a 32 bit integer in the whole
bitcoin constructors without loss of utility. Doing so removes the
potential panic.
This is a breaking API change. We elect not to deprecate because we want
to keep the same function names.1 parent 1702fdd commit ef92709
2 files changed
Lines changed: 14 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
134 | 127 | | |
135 | 128 | | |
136 | 129 | | |
137 | 130 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
145 | 135 | | |
146 | | - | |
| 136 | + | |
147 | 137 | | |
148 | 138 | | |
149 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
135 | 128 | | |
136 | 129 | | |
137 | 130 | | |
138 | 131 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 132 | + | |
144 | 133 | | |
145 | | - | |
| 134 | + | |
146 | 135 | | |
147 | 136 | | |
148 | | - | |
| 137 | + | |
149 | 138 | | |
150 | 139 | | |
151 | 140 | | |
| |||
0 commit comments