Skip to content

Commit

Permalink
Fix txs from 1 JM wallet to other in 1 Core wallet.
Browse files Browse the repository at this point in the history
Previous to this commit, if a tumbler run sent coins from
one Joinmarket wallet to another, with both tracked by the
same rpc_wallet_file (multiwallet) in same Core instance,
the sweep txs would be lost because, while the code
correctly identified that the destination was already
imported, the transaction monitor filtered all transactions
not tied to the source wallet's label. This filter was not
necessary (and was not in the pre-PR version of the code,
which is why it worked before), and so is removed except for
the 'all' type callbacks, which will not want to track
txs not relevant to this JM wallet.
  • Loading branch information
AdamISZ committed Oct 23, 2019
1 parent 3a60c67 commit 68bf872
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions jmclient/jmclient/wallet_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ def transaction_monitor(self):

for tx in new_txs:
txid = tx["txid"]
# filter on this Joinmarket wallet label, or the
# external monitoring label:
if "label" not in tx or tx["label"] not in [
self.EXTERNAL_WALLET_LABEL, self.get_wallet_name()]:
continue
res = self.bci.get_transaction(txid)
if not res:
continue
Expand Down Expand Up @@ -228,11 +223,14 @@ def transaction_monitor(self):

# first fire 'all' type callbacks, irrespective of if the
# transaction pertains to anything known (but must
# have correct label per above):
for f in self.callbacks["all"]:
# note we need no return value as we will never
# remove these from the list
f(txd, txid)
# have correct label per above); filter on this Joinmarket wallet label,
# or the external monitoring label:
if "label" in tx and tx["label"] in [
self.EXTERNAL_WALLET_LABEL, self.get_wallet_name()]:
for f in self.callbacks["all"]:
# note we need no return value as we will never
# remove these from the list
f(txd, txid)

# The tuple given as the second possible key for the dict
# is such because dict keys must be hashable types, so a simple
Expand Down

0 comments on commit 68bf872

Please sign in to comment.