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
Branch
PR13252
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7614
Build 13268: Bitcoin ABC Buildbot (legacy)
Build 13267: arc lint + arc unit

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

This change was made in D1494.

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