Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2323,6 +2323,12 @@ TransactionError CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bool& comp
}
const PrecomputedTransactionData txdata = PrecomputePSBTData(psbtx);
LOCK(cs_wallet);
if (sign && IsLocked()) {
// A mixing-only unlock still exposes private keys to the
// ScriptPubKeyMans, so refuse to sign here and report zero signed inputs.
sign = false;
n_signed = nullptr;
}
// Get all of the previous transactions
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
const CTxIn& txin = psbtx.tx->vin[i];
Expand Down
4 changes: 4 additions & 0 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def run_test(self):
unsigned_tx = self.nodes[0].walletprocesspsbt(psbtx, False)
assert_equal(unsigned_tx['complete'], False)

# Unlocking for mixing only must not allow signing either
self.nodes[0].walletpassphrase("password", 1000000, True)
assert_equal(self.nodes[0].send({self.nodes[2].getnewaddress(): 10})['complete'], False)

self.nodes[0].walletpassphrase(passphrase="password", timeout=1000000)

# Sign the transaction but don't finalize
Expand Down
Loading