Page MenuHomePhabricator

Merge #13252: Wallet: Refactor ReserveKeyFromKeyPool for safety
ClosedPublic

Authored by nakihito on Sep 27 2019, 00:53.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 27 2019, 00:53
deadalnix requested changes to this revision.Sep 27 2019, 12:58
deadalnix added inline comments.
src/wallet/wallet.cpp
3686 ↗(On Diff #13167)

There are clearly backports that are missing here.

This revision now requires changes to proceed.Sep 27 2019, 12:58
src/wallet/wallet.cpp
3985 ↗(On Diff #13181)

This change was made in D1494.

This revision is now accepted and ready to land.Sep 28 2019, 14:50