Page MenuHomePhabricator

Create wallet RPCs for PSBT
ClosedPublic

Authored by deadalnix on Sat, Nov 2, 01:43.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf25d2ad300d9: Create wallet RPCs for PSBT
Summary

walletprocesspsbt takes a PSBT format transaction, updates the
PSBT with any inputs related to this wallet, signs, and finalizes
the transaction. There is also an option to not sign and just
update.

walletcreatefundedpsbt creates a PSBT from user provided data
in the same form as createrawtransaction. It also funds the transaction
and takes an options argument in the same form as fundrawtransaction.
The resulting PSBT is blank with no input or output data filled
in.

This is a partial backport of Core PR13557 : https://github.com/bitcoin/bitcoin/pull/13557/commits/a4b06fb42eb0ad94e562ca839391b57e69285136

Depends on D4351

Test Plan

Unfortunately, the test have all been dumped at once at the end.

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

deadalnix created this revision.Sat, Nov 2, 01:43
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Nov 2, 01:43
Fabien requested changes to this revision.Mon, Nov 4, 13:09
Fabien added a subscriber: Fabien.

This deserves release notes.

src/wallet/rpcwallet.cpp
4694 ↗(On Diff #13869)

Nit: Sighash vs sighash

4769 ↗(On Diff #13869)

default=ALL|FORKID

4807 ↗(On Diff #13869)

This doesn't check for FORKID:

if (!nHashType.hasForkId()) {
    throw JSONRPCError(RPC_INVALID_PARAMETER, "Signature must use SIGHASH_FORKID");
}
This revision now requires changes to proceed.Mon, Nov 4, 13:09
deadalnix updated this revision to Diff 14025.Sat, Nov 9, 15:58

Address comments

Fabien accepted this revision.Sat, Nov 9, 17:22
This revision is now accepted and ready to land.Sat, Nov 9, 17:22
This revision was automatically updated to reflect the committed changes.