@@ -954,13 +954,6 @@ def release_funds(self, order_id):
954954 This function should be called to release funds from a disputed contract after
955955 the moderator has resolved the dispute and provided his signature.
956956 """
957- def sort_outpoints ():
958- o = []
959- for s in contract ["dispute_resolution" ]["resolution" ]["tx_signatures" ]:
960- for outpoint in outpoints :
961- if COutPoint (lx (outpoint ["txid" ]), outpoint ["vout" ]).encode ("hex" ) == s ["outpoint" ]:
962- o .append (outpoint )
963- outpoints = o
964957
965958 if os .path .exists (os .path .join (DATA_FOLDER , "purchases" , "in progress" , order_id + ".json" )):
966959 file_path = os .path .join (DATA_FOLDER , "purchases" , "in progress" , order_id + ".json" )
@@ -992,10 +985,15 @@ def sort_outpoints():
992985 ["resolution" ]["vendor_payout" ]) * 100000000 )),
993986 'address' : vendor_address })
994987
988+ # version 0.2.1 and above ensure same sort order as moderator.
989+ o = []
995990 for s in contract ["dispute_resolution" ]["resolution" ]["tx_signatures" ]:
996991 if "outpoint" in s :
997- sort_outpoints ()
998- break
992+ for outpoint in outpoints :
993+ if COutPoint (lx (outpoint ["txid" ]), outpoint ["vout" ]).encode ("hex" ) == s ["outpoint" ]:
994+ o .append (outpoint )
995+ if len (o ) != 0 :
996+ outpoints = o
999997 tx = BitcoinTransaction .make_unsigned (outpoints , outputs , testnet = self .protocol .multiplexer .testnet )
1000998 chaincode = contract ["buyer_order" ]["order" ]["payment" ]["chaincode" ]
1001999 redeem_script = str (contract ["buyer_order" ]["order" ]["payment" ]["redeem_script" ])
0 commit comments