Skip to content

Commit 0f3acec

Browse files
committed
Add test that walletprocesspsbt requires unlocked wallet when signing
1 parent 0e89521 commit 0f3acec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/functional/rpc_psbt.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def run_test(self):
108108
psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt']
109109
assert_equal(psbtx1, psbtx)
110110

111+
# Node 0 should not be able to sign the transaction with the wallet is locked
112+
self.nodes[0].encryptwallet("password")
113+
assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first", self.nodes[0].walletprocesspsbt, psbtx)
114+
115+
# Node 0 should be able to process without signing though
116+
unsigned_tx = self.nodes[0].walletprocesspsbt(psbtx, False)
117+
assert_equal(unsigned_tx['complete'], False)
118+
119+
self.nodes[0].walletpassphrase(passphrase="password", timeout=1000000)
120+
111121
# Sign the transaction and send
112122
signed_tx = self.nodes[0].walletprocesspsbt(psbtx)['psbt']
113123
final_tx = self.nodes[0].finalizepsbt(signed_tx)['hex']

0 commit comments

Comments
 (0)