Page MenuHomePhabricator

Fix signrawtransaction failing when a wallet URI is specified
ClosedPublic

Authored by Fabien on Apr 4 2019, 12:16.

Details

Summary

The issue has been raised by @florian.

Since D2007, the signrawtransaction RPC is routing the call to two new
RPCs, signrawtransactionwithkey and signrawtransactionwithwallet.
The routing is achieved by creating a copy of the JSON request and
forwading it to the new method.

The request URI is not copied during the process, which introduces a
regression when a node which uses multiple wallets calls
signrawtransaction: the request returns an error because the wallet is
not specified.

This diff forwards the URI to the signrawtransactionwith* RPCs and
adds a test case to check the behavior.

Test Plan
./test/functional/test_runner.py rpc_signrawtransaction

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Apr 4 2019, 12:16
Herald added a reviewer: Restricted Project. · View Herald TranscriptApr 4 2019, 12:16
Herald added a subscriber: schancel. · View Herald Transcript

Does the problem exist in Core ?

Fabien added a comment.Apr 4 2019, 15:14

signrawtransaction is now deprecated on core, so the issue cannot happen anymore.
Up to the removal of the RPC the URI was not forwarded, and I couldn't find anything related to the issue in core, I suppose the issue has never been found or never occurred.
@florian also told me that he did some research and couldn't find anything either.

Fabien updated this revision to Diff 7944.Apr 4 2019, 15:17

Rebase

florian accepted this revision.Apr 4 2019, 17:02

Yeah, the issue exists in core in all actively maintained branches, except for v18.0 (removed the rpc) which should be released soon. Thanks for handling this, Fabien!

This revision is now accepted and ready to land.Apr 4 2019, 17:02

So if they have a fix, why not backport it ?

florian added a comment.Apr 4 2019, 17:41

They don't have a fix. It seems they've never bumped into this problem. Core v18.0 is the only bug-free branch only because they removed the rpc entirely. I suppose we're only planning to remove that rpc in v20.0.

jasonbcox accepted this revision.Apr 5 2019, 15:56
This revision was automatically updated to reflect the committed changes.