diff options
author | fanquake <fanquake@gmail.com> | 2023-06-13 17:06:03 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-06-13 17:08:07 +0100 |
commit | da494186f2c0863a294029a5af9c4b57aeb03b40 (patch) | |
tree | 0556019a2feb3786f626fba70caaa8932405391b /src/chainparams.cpp | |
parent | 58b36fc303df604bbfb9a752a58262b51c26bab9 (diff) | |
parent | 76c5ea703e77d580b6962e60398f4988cbd9b58b (diff) |
Merge bitcoin/bitcoin#27806: fuzz: Fix mini_miner_selection running out of coin
76c5ea703e77d580b6962e60398f4988cbd9b58b fuzz: Fix mini_miner_selection running out of coin (Murch)
Pull request description:
Fixes a bug in the mini_miner_selection fuzz test found by fuzzing: It was possible for the mini_miner_selection fuzz test to generated transactions that created fewer new outputs than the two inputs they each spent. If the fuzz seed did so consistently, eventually it would cause a `pop_front()` on an empty available_coins which resulted in undefined behavior.
Fixed per belt-suspender approach:
- assert that available_coins is not empty before generating tx
- generate at least two coins per new tx
- allow building tx with a single input if only one coin is available
ACKs for top commit:
MarcoFalke:
lgtm ACK 76c5ea703e77d580b6962e60398f4988cbd9b58b
dergoegge:
reACK 76c5ea703e77d580b6962e60398f4988cbd9b58b
Tree-SHA512: 5b7ffd1905a712733ad5364958ad79874dd8c31bd50069b0d3e6f734da0f2d496cb08cbe0afa47115674313e1cb7166a6087f2ccbce289774caddc790583e241
Diffstat (limited to 'src/chainparams.cpp')
0 files changed, 0 insertions, 0 deletions