HomePhabricator

Merge #13252: Wallet: Refactor ReserveKeyFromKeyPool for safety

Description

Merge #13252: Wallet: Refactor ReserveKeyFromKeyPool for safety

Summary:
4b62bdf5136c174621509bf7866fbd89b61cc66a Wallet: Refactor ReserveKeyFromKeyPool for safety (Ben Woosley)

Pull request description:

ReserveKeyFromKeyPool's previous behaviour is to set nIndex to -1 if the keypool is
empty, OR throw an exception for technical failures. Instead, we now return false
if the keypool is empty, true if the operation succeeded.

This is to make failure more easily detectable by calling code.

Tree-SHA512: 753f057ad13bd4c28d121f426bf0967ed72b827d97fb24582f9326ec60072abc5482e3db69ccada7c5fc66de9957fc59098432dd223fc4116991cab44c6d7aef

Backport of Core PR13252
https://github.com/bitcoin/bitcoin/pull/13252/

Depends on D4207

Test Plan:

make check
test_runner.py

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4166

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on May 30 2018, 17:38
nakihitoCommitted on Oct 7 2019, 18:53
nakihitoPushed on Oct 7 2019, 23:08
Reviewer
Restricted Owners Package
Differential Revision
D4166: Merge #13252: Wallet: Refactor ReserveKeyFromKeyPool for safety
Parents
rSTAGING79eec8bc0714: [build-configurations] Resurface the more informative error message when…
Branches
Unknown
Tags
Unknown