Skip to content

Commit

Permalink
removed json_out check
Browse files Browse the repository at this point in the history
we don't want to use the same multisig address **period**. be it for the same outputs, or for different outputs
  • Loading branch information
kolinko committed Jul 6, 2014
1 parent fcb48df commit 89a42a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ def handle_request(self, request):
used_input_db = UsedInput(self.oracle.db)
for i in all_inputs:
used_input = used_input_db.get_input(i)
if used_input and used_input["json_out"] != rq_hash:
if used_input:
self.oracle.communication.broadcast(
'AddressDuplicate',
'this multisig address was already used in another transaction')
return
for i in all_inputs:
used_input_db.save({
'input_hash': i,
'json_out': rq_hash
'input_hash': i
})

prevtx = tx['prevtx']
Expand Down
7 changes: 3 additions & 4 deletions src/oracle/oracle_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,12 @@ class UsedInput(TableDb):
create_sql = "create table {0} ( \
id integer primary key autoincrement, \
ts datetime default current_timestamp, \
input_hash text unique, \
json_out text not null);"
input_hash text unique);"
insert_sql = "insert or ignore into {0} (input_hash, json_out) values (?, ?)"
exists_sql = "select * from {0} where input_hash=?"

def args_for_obj(self, obj):
return [obj["input_hash"], obj["json_out"]]
return [obj["input_hash"]]

def get_input(self, i):
sql = self.exists_sql.format(self.table_name)
Expand Down

0 comments on commit 89a42a7

Please sign in to comment.