Skip to content

Commit

Permalink
Disable Multi‐Sig Output Spending (Untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkrellenstein authored and JahPowerBit committed Feb 5, 2015
1 parent 81a4e61 commit 3788610
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
## Client Versions ##
* v9.49.5 (???)
* automatically spend 1‐of‐`N` multisig outputs
* v9.49.4 (2014-02-05)
* reconceived this package as a libary
* moved CLI to new repository: `counterparty-cli`
Expand Down
10 changes: 2 additions & 8 deletions counterpartylib/lib/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,14 @@ def get_btc_supply(normalize=False):
return total_supply if normalize else int(total_supply * config.UNIT)

def is_vout_spendable(vout, source):
# TODO: Support multi‐sig sources.
source = script.make_canonical(source)
scriptpubkey_hex = vout['scriptPubKey']['hex']
c_scriptpubkey = bitcoinlib.core.CScript(bitcoinlib.core.x(scriptpubkey_hex))
vout_address = script.scriptpubkey_to_address(c_scriptpubkey)
if not vout_address:
return False
if script.is_multisig(vout_address) and not script.is_multisig(source):
signatures_required, pubkeyhashes, signatures_possible = script.extract_array(vout_address)
if signatures_required == 1 and source in pubkeyhashes:
return True
else:
if vout_address == source:
return True
if vout_address == source:
return True
return False

def get_unspent_txouts(source, return_confirmed=False):
Expand Down

0 comments on commit 3788610

Please sign in to comment.