Bug
FlyClient::NetworkStd::Connection OnMsg(ProofKernel2) handling in core/fly_client.cpp (~line 1165):
if (req.m_Res.m_Kernel->IsValid(req.m_Res.m_Height))
ThrowUnexpected();
The condition is inverted — it throws when the returned kernel IS valid. Every sibling check in the file, including the Kernel3 branch immediately below (if (!req.m_Res.m_Kernel->IsValid(...)) ThrowUnexpected();), throws on !IsValid. Introduced by 7a38b48 ("proto: added GetProofKernel3") while refactoring the pre-existing code, which used !IsValid.
Impact
The fetched-kernel path of RequestKernel2 is exercised by atomic-swap redeem-secret extraction: the wallet fetches the counterparty's redeem kernel to extract the shared secret. With the inverted check every valid response kills the node connection (ThrowUnexpected), the wallet reconnects and retries forever — swap redeems hang. Unnoticed because swap_test has been disabled in wallet/unittests/CMakeLists.txt since 2023; resurrecting it hangs on the first full-swap scenario and passes with the ! restored.
Part of #2070.
Bug
FlyClient::NetworkStd::ConnectionOnMsg(ProofKernel2)handling incore/fly_client.cpp(~line 1165):The condition is inverted — it throws when the returned kernel IS valid. Every sibling check in the file, including the
Kernel3branch immediately below (if (!req.m_Res.m_Kernel->IsValid(...)) ThrowUnexpected();), throws on!IsValid. Introduced by 7a38b48 ("proto: added GetProofKernel3") while refactoring the pre-existing code, which used!IsValid.Impact
The fetched-kernel path of
RequestKernel2is exercised by atomic-swap redeem-secret extraction: the wallet fetches the counterparty's redeem kernel to extract the shared secret. With the inverted check every valid response kills the node connection (ThrowUnexpected), the wallet reconnects and retries forever — swap redeems hang. Unnoticed becauseswap_testhas been disabled inwallet/unittests/CMakeLists.txtsince 2023; resurrecting it hangs on the first full-swap scenario and passes with the!restored.Part of #2070.