Skip to content

Use of undocumented/undefined boost::signals2 behavior in wallet #26442

@theuni

Description

@theuni

While working on a minimal rewrite for our remaining usage of boost::signals2 (POC branch here), I stumbled upon some undocumented/undefined behavior with our current usage.

Specifically the problem, introduced in #17261, is that signals aren't intended to connect to other signals. Currently this is violated in the wallet: https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L3518

See the boost discussion here: https://groups.google.com/g/boost-list/c/So4i8JXneJ0

On my WIP replacement branch I implemented it by chaining the calls as suggested (and as-intended in our code):
https://github.com/theuni/bitcoin/blob/replace-boost-signals/src/btcsignals.h#L140 . This makes tests happy, so presumably that's what's going on with boost too, though there are details (like interim disconnections) which could give us trouble in the future.

Regardless of the fact that this works for now, I don't think that we should be relying on it. I haven't looked into the details, but I'm hoping it could be fixed with some simple stub functions.

Ping @achow101. Any easy/obvious workarounds?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions