Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

taker checks for duplicate utxos now in recv_txio() #455

Closed
wants to merge 2 commits into from

Conversation

chris-belcher
Copy link
Collaborator

Please review

@@ -112,14 +112,19 @@ def recv_txio(self, nick, utxo_list, cj_pub, change_addr):
log.debug(('recv_txio => nick={} not in '
'nonrespondants {}').format(nick, self.nonrespondants))
return
self.utxos[nick] = utxo_list
utxo_data = jm_single().bc_interface.query_utxo_set(self.utxos[nick])
duplicate_utxos = set(sum(self.utxos.values(), [])).intersection(set(utxo_list))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • self.utxos.values() is the sets of coins sent by each nick as inputs
  • sum(list_of_lists, []) is an idiom for flatten

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectively [] + list_of_lists[0] + list_of_lists[1] + ...

@AdamISZ
Copy link
Member

AdamISZ commented Mar 16, 2016

Although the taker could choose to infer that both copies are from a "naughty" maker and treat both as non-responding, I presume there (might?) be a dos vector that way (although a bit theoretical? auth is under encryption).

Do we consider that this needs a test that triggers the error?

@chris-belcher
Copy link
Collaborator Author

Yes you're right, it could blame bother makers rather than the one that happened to respond second. That should've be too hard, I'll add it to that branch soonish.

Yes a test would be great. I'll add that too (maybe ask you guys on IRC some details about it)

@chris-belcher
Copy link
Collaborator Author

The reason I've left this so long is it's not trivial, there would need to be some records kept in the code for which maker contributed what in fees and utxos, so that both makers can be evicted if they clash.

@AdamISZ AdamISZ force-pushed the develop branch 3 times, most recently from 97d2603 to 47479d5 Compare September 13, 2016 11:23
@chris-belcher chris-belcher deleted the check-dup-utxo branch November 5, 2016 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants