Skip to content

Commit

Permalink
Allow creating a transaction without unlocking the wallet IF transact…
Browse files Browse the repository at this point in the history
…ion is unsigned
  • Loading branch information
cjdelisle committed Jan 2, 2024
1 parent b48198b commit dfce82c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pktwallet/wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,19 @@ out:
for {
select {
case txr := <-w.createTxRequests:
heldUnlock, err := w.holdUnlock()
if err != nil {
txr.resp <- createTxResponse{nil, err}
continue
var hu heldUnlock
if txr.req.SendMode > SendModeUnsigned {
h, err := w.holdUnlock()
if err != nil {
txr.resp <- createTxResponse{nil, err}
continue
}
hu = h
}
tx, err := w.txToOutputs(txr.req)
heldUnlock.release()
if hu != nil {
hu.release()
}
txr.resp <- createTxResponse{tx, err}
case <-quit:
break out
Expand Down

0 comments on commit dfce82c

Please sign in to comment.