HomePhabricator

Merge #13512: [qa] mininode: Expose connection state through is_connected

Description

Merge #13512: [qa] mininode: Expose connection state through is_connected

Summary:
fa1eac9cdb [qa] mininode: Expose connection state through is_connected (MarcoFalke)

Pull request description:

This gets rid of some non-type safe string comparisons and access to members that are implementation details of `class P2PConnection(asyncore.dispatcher)`. Such refactoring is required to replace the deprecated asyncore with something more sane.

Changes:
* Get rid of non-enum member `state` and replace is with bool `connected`
* Get rid of confusing argument `pushbuf` and literally just push to the buffer at the call site

Tree-SHA512: 09074c7e5ed251a2e0509ef205ab82f89887c1e1fa1cc6efc1db60d196eb2403788a4987df8809fd06d80ef652e614c5d3c3fdef70096fc5815102243388288d

Backport of Core PR13512
https://github.com/bitcoin/bitcoin/pull/13512/files
Completes T679

Test Plan: test_runner.py

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Jun 23 2018, 23:28
jasonbcoxCommitted on Sep 6 2019, 15:24
jasonbcoxPushed on Sep 6 2019, 15:24
Reviewer
Restricted Project
Differential Revision
D4011: Merge #13512: [qa] mininode: Expose connection state through is_connected
Parents
rABC27ebde13667a: Fix incorrectly backported return statements in mininode.py
Branches
Unknown
Tags
Unknown