Page MenuHomePhabricator

rpc: Better way to allow shutdown while in generateblocks
ClosedPublic

Authored by PiRK on Oct 9 2020, 07:38.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCd7c587d711de: rpc: Better way to allow shutdown while in generateblocks
Summary

By checking the shutdown flag every loop we can use the entire nonce space
instead of breaking every 16 bits to check the shutdown flag.

This has been possible since the shutdown flag was switched to an atomic,
before that change it was controlled by a condition variable and lock.

Backport of Core PR16262

Test Plan

ninja && ninja check-all

This still runs fine:

addr=`src/bitcoin-cli -regtest getnewaddress`
bitcoin-cli -regtest generatetoaddress 100 $addr

This command can still be interrupted cleanly with Ctrl-C:

bitcoin-cli -regtest generatetoaddress 100000 $addr

Diff Detail

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