Skip to content

Commit

Permalink
inputs_addresses -> unique_scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kolinko committed Jul 5, 2014
1 parent fca5310 commit a16db96
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/oracle/handlers/conditionedtransactionhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ def valid_task(self, task):
return valid_task


def inputs_addresses(self, prevtxs):
addresses = set()
def unique_scripts(self, prevtxs):
scripts = set()
for prevtx in prevtxs:
if not 'redeemScript' in prevtx:
return False
script = prevtx['redeemScript']
address = self.oracle.btc.get_address_from_script(script)
addresses.add(address)
return list(addresses)
scripts.add(prevtx['redeemScript'])
return list(scripts)

def includes_me(self, prevtx):
for tx in prevtx:
Expand Down Expand Up @@ -98,7 +96,7 @@ def verify_transaction(self, tx):
logging.debug("transaction invalid")
raise TransactionVerificationError()

if len(self.inputs_addresses(prevtx))>1:
if len(self.unique_scripts(prevtx))>1:
logging.debug("all inputs should go from the same multisig address")
raise TransactionVerificationError()

Expand Down

0 comments on commit a16db96

Please sign in to comment.