-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[RPC] Split signrawtransaction into wallet and non-wallet RPC command #10579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Incorrect scripted diff. |
0b7c0c2
to
1283d87
Compare
I'm not entirely sure if this is a good long term strategy. Where are the differences between |
@jonasschnelli |
a1d577b
to
a15695a
Compare
7725585
to
05c3cf5
Compare
This has missed the 0.15 feature freeze, moving to 0.16. |
needs rebase |
8674057
to
aea7072
Compare
rebased |
aea7072
to
744c9a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some review comments inline. It's a shame that this doesn't remove the server->wallet dependency, but it's a good first step in that direction.
I felt bad about asking you to rebase and then not actually reviewing before it got stale again, so I rebased it myself here: https://github.com/jnewbery/bitcoin/tree/pr10579 . Feel free to grab that branch if it helps.
src/rpc/client.cpp
Outdated
@@ -95,6 +95,9 @@ static const CRPCConvertParam vRPCConvertParams[] = | |||
{ "createrawtransaction", 3, "replaceable" }, | |||
{ "signrawtransaction", 1, "prevtxs" }, | |||
{ "signrawtransaction", 2, "privkeys" }, | |||
{ "signrawtransactionwithwallet", 1, "prevtxs" }, | |||
{ "signrawtransactionwithkey", 2, "prevtxs" }, | |||
{ "signrawtransactionwithkey", 1, "privkeys" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supernit: 1 usually comes before 2 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnewbery for me it's more "Sort please"
src/Makefile.am
Outdated
@@ -132,6 +132,7 @@ BITCOIN_CORE_H = \ | |||
rpc/protocol.h \ | |||
rpc/server.h \ | |||
rpc/register.h \ | |||
rpc/rawtransaction.h \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the first commit (6fded798a77e8a754fa9455afd3328aee0842274)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and sorted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following lines aren't sorted either, not sure if it matters to clean this up
test/functional/txn_clone.py
Outdated
@@ -74,7 +74,7 @@ def run_test(self): | |||
|
|||
# Use a different signature hash type to sign. This creates an equivalent but malleated clone. | |||
# Don't send the clone anywhere yet | |||
tx1_clone = self.nodes[0].signrawtransactionwithwallet(clone_raw, None, None, "ALL|ANYONECANPAY") | |||
tx1_clone = self.nodes[0].signrawtransactionwithwallet(clone_raw, None, "ALL|ANYONECANPAY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this change before the scripted diff commit (to not break git bisect). You could change the args to be named args while you're doing that.
|
||
# 1) The transaction has a complete set of signatures | ||
assert 'complete' in rawTxSigned | ||
assert_equal(rawTxSigned['complete'], True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for assert_equal(thing, True)
. Just use assert thing
|
||
# 3) The transaction has no complete set of signatures | ||
assert 'complete' in rawTxSigned | ||
assert_equal(rawTxSigned['complete'], False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use assert not thing
src/rpc/rawtransaction.cpp
Outdated
#ifdef ENABLE_WALLET | ||
else if (request.params[2].isNull()) { | ||
newRequest.params.push_back(request.params[0]); | ||
newRequest.params.push_back(request.params[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: add a comment here to say that signrawtransactionwithwallet
doesn't take a privkeys
parameter.
src/rpc/rawtransaction.cpp
Outdated
return signtransaction(mtx, request.params[2], &keystore, true, request.params[3]); | ||
} | ||
|
||
UniValue signrawtransaction(const JSONRPCRequest& request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps hide this RPC behind a deprecated command line argument (similar to #11031)
src/rpc/rawtransaction.cpp
Outdated
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true); | ||
|
||
CMutableTransaction mtx; | ||
if (!DecodeHexTx(mtx, request.params[0].get_str(), true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I know these are moves, but there's so few of them that you might as well add braces to the if
s.
src/rpc/rawtransaction.cpp
Outdated
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true); | ||
|
||
// Make a JSONRPCRequest to pass on to the right signrawtransaction* command | ||
JSONRPCRequest newRequest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use snake_case for variables in new functions.
src/rpc/rawtransaction.cpp
Outdated
@@ -641,86 +641,13 @@ UniValue combinerawtransaction(const JSONRPCRequest& request) | |||
return EncodeHexTx(mergedTx); | |||
} | |||
|
|||
UniValue signrawtransaction(const JSONRPCRequest& request) | |||
UniValue signtransaction(CMutableTransaction& mtx, const UniValue& prevTxsUnival, CBasicKeyStore *keystore, bool tempKeystore, const UniValue& hashType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: new function parameters should be snake_case
rawTxSigned = self.nodes[0].signrawtransactionwithkey(rawTx, privKeys, inputs) | ||
|
||
# 1) The transaction has a complete set of signatures | ||
assert 'complete' in rawTxSigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove key asserts since below you assert the value, which fail in case the key is not defined? cc @jnewbery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The line below should raise KeyError in that case.
src/rpc/rawtransaction.h
Outdated
/** Sign a transaction with the given keystore and previous transactions */ | ||
UniValue signtransaction(CMutableTransaction& mtx, const UniValue& prevTxs, CBasicKeyStore *keystore, bool tempKeystore, const UniValue& hashType); | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif // BITCOIN_RPC_RAWTRANSACTION_H
#ifndef BITCOIN_RPC_RAWTRANSACTION_H | ||
#define BITCOIN_RPC_RAWTRANSACTION_H | ||
|
||
class CBasicKeyStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown types below: CMutableTransaction
and UniValue
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not addressed in f5a3e0d4a3b4b359714b7d380d7784b7ca0524c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. It must have gotten lost somewhere.
src/wallet/rpcwallet.cpp
Outdated
@@ -18,6 +18,7 @@ | |||
#include "policy/rbf.h" | |||
#include "rpc/mining.h" | |||
#include "rpc/server.h" | |||
#include "rpc/rawtransaction.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort.
src/rpc/rawtransaction.cpp
Outdated
@@ -888,6 +786,185 @@ UniValue signrawtransaction(const JSONRPCRequest& request) | |||
return result; | |||
} | |||
|
|||
UniValue signrawtransactionwithkey(const JSONRPCRequest& request) | |||
{ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove newline.
src/rpc/rawtransaction.cpp
Outdated
|
||
CBasicKeyStore keystore; | ||
UniValue keys = request.params[1].get_array(); | ||
for (unsigned int idx = 0; idx < keys.size(); idx++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++idx
.
src/rpc/rawtransaction.cpp
Outdated
if (!fGood) | ||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); | ||
CKey key = vchSecret.GetKey(); | ||
if (!key.IsValid()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces.
src/rpc/rawtransaction.cpp
Outdated
UniValue k = keys[idx]; | ||
CBitcoinSecret vchSecret; | ||
bool fGood = vchSecret.SetString(k.get_str()); | ||
if (!fGood) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take the opportunity to kill fGood
:
if (!vchSecret.SetString(k.get_str())) {
src/rpc/rawtransaction.cpp
Outdated
return signrawtransactionwithwallet(newRequest); | ||
} | ||
#endif | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else {
src/rpc/rawtransaction.cpp
Outdated
@@ -970,7 +1047,8 @@ static const CRPCCommand commands[] = | |||
{ "rawtransactions", "decodescript", &decodescript, true, {"hexstring"} }, | |||
{ "rawtransactions", "sendrawtransaction", &sendrawtransaction, false, {"hexstring","allowhighfees"} }, | |||
{ "rawtransactions", "combinerawtransaction", &combinerawtransaction, true, {"txs"} }, | |||
{ "rawtransactions", "signrawtransaction", &signrawtransaction, false, {"hexstring","prevtxs","privkeys","sighashtype"} }, /* uses wallet if enabled */ | |||
{ "rawtransactions", "signrawtransaction", &signrawtransaction, true, {"hexstring","prevtxs","privkeys","sighashtype"} }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, align this and above lines? 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK d602348.
#define BITCOIN_RPC_RAWTRANSACTION_H | ||
|
||
class CBasicKeyStore; | ||
class CMutableTransaction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, gives compiler warning:
In file included from rpc/rawtransaction.cpp:20:
./rpc/rawtransaction.h:9:1: warning: class 'CMutableTransaction' was previously declared as a struct [-Wmismatched-tags]
class CMutableTransaction;
^
./primitives/transaction.h:362:8: note: previous use is here
struct CMutableTransaction
^
./rpc/rawtransaction.h:9:1: note: did you mean struct here?
class CMutableTransaction;
^~~~~
struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this on my machine..
reACK d602348 |
utACK d602348 |
…et RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of #10570. It also builds on top of #10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for #10579 - this was called out in code review. #10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
Signed-off-by: pasta <pasta@dashboost.org>
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
Signed-off-by: pasta <pasta@dashboost.org>
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
Signed-off-by: pasta <pasta@dashboost.org>
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
…on-wallet RPC command d602348 Add test for signrawtransaction (Andrew Chow) eefff65 scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests (Andrew Chow) 1e79c05 Split signrawtransaction into wallet and non-wallet (Andrew Chow) Pull request description: This PR is part of bitcoin#10570. It also builds on top of bitcoin#10571. This PR splits `signrawtransaction` into two commands, `signrawtransactionwithkey` and `signrawtransactionwithwallet`. `signrawtransactionwithkey` requires private keys to be passed in and does not use the wallet for any signing. `signrawtransactionwithwallet` uses the wallet to sign a raw transaction and does not have any parameters to take private keys. The `signrawtransaction` RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior. All tests that used `signrawtransaction` have been updated to use one of the two new RPCs. Most uses were changed to `signrawtransactionwithwallet`. These were changed via a scripted diff. Tree-SHA512: d0adf5b4cd7077639c504ec07bee262a3b94658d34db0a5c86a263b6393f7aa62f45129eafe29a7c861aa58440dd19348ee0c8b685e8a62d6f4adae8ec8f8cb3
Signed-off-by: pasta <pasta@dashboost.org>
…action.h eacc5b2 Declare CMutableTransaction a struct in rawtransaction.h (Ben Woosley) Pull request description: Because it's a struct. Fix for bitcoin#10579 - this was called out in code review. bitcoin#10579 (comment) Tree-SHA512: 10758a667218481de6f50b5ed874e92eb350c621f7a6355fba7da6ab42b09e1764f827e89491c8663e554fcfd23f124b299f968237c6ad1ff7819e211bd7e521
Signed-off-by: pasta <pasta@dashboost.org>
This PR is part of #10570. It also builds on top of #10571.
This PR splits
signrawtransaction
into two commands,signrawtransactionwithkey
andsignrawtransactionwithwallet
.signrawtransactionwithkey
requires private keys to be passed in and does not use the wallet for any signing.signrawtransactionwithwallet
uses the wallet to sign a raw transaction and does not have any parameters to take private keys.The
signrawtransaction
RPC has been marked as deprecated and will call the appropriate RPC command based upon the parameters given. A test was added to check this behavior is still consistent with the original behavior.All tests that used
signrawtransaction
have been updated to use one of the two new RPCs. Most uses were changed tosignrawtransactionwithwallet
. These were changed via a scripted diff.