Skip to content

Commit

Permalink
Merge JoinMarket-Org#1126: Allow RPC coinjoin taker_finished to accep…
Browse files Browse the repository at this point in the history
…t unconf

fe46b7e Allow RPC coinjoin taker_finished to accept unconf (Adam Gibson)
  • Loading branch information
AdamISZ committed Dec 26, 2021
2 parents 4933c61 + fe46b7e commit 76cb730
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions jmclient/jmclient/wallet_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,22 @@ def taker_finished(self, res, fromtx=False, waittime=0.0, txdetails=None):
# TODO this may be updated.
# It is also different in that the event loop must not shut down
# when processing finishes.
assert fromtx is False

# This assertion is making sure that the callback is not a non-final
# schedule entry (see the comment above as to why). We accept
# either False or 'unconfirmed' since they can arrive in either order.
assert fromtx is not True

# reset our state on completion, we are no longer coinjoining:
self.taker = None

if not res:
jlog.info("Coinjoin did not complete successfully.")
#Should usually be unreachable, unless conf received out of order;
#because we should stop on 'unconfirmed' for last (see above)
else:
jlog.info("Coinjoin completed correctly")
# reset our state on completion, we are no longer coinjoining:
self.taker = None

# Note; it's technically possible for this to return False if somehow
# we are currently in inactive state, but it isn't an error:
self.activate_coinjoin_state(CJ_NOT_RUNNING)
Expand Down

0 comments on commit 76cb730

Please sign in to comment.