forked from bitcoinafterlife/bal-electrum-plugin
a lot
This commit is contained in:
8
will.py
8
will.py
@@ -72,6 +72,8 @@ class Will:
|
||||
for txin in will[wid].tx.inputs():
|
||||
txid = txin.prevout.txid.hex()
|
||||
if txid in will:
|
||||
#print(will[txid].tx.outputs())
|
||||
#print(txin.prevout.out_idx)
|
||||
change = will[txid].tx.outputs()[txin.prevout.out_idx]
|
||||
txin._trusted_value_sats = change.value
|
||||
try:
|
||||
@@ -88,8 +90,11 @@ class Will:
|
||||
to_delete = []
|
||||
to_add = {}
|
||||
#add info from wallet
|
||||
willitems={}
|
||||
for wid in will:
|
||||
Will.add_info_from_will(will,wid,wallet)
|
||||
willitems[wid]=WillItem(will[wid])
|
||||
will=willitems
|
||||
errors ={}
|
||||
for wid in will:
|
||||
|
||||
@@ -110,7 +115,7 @@ class Will:
|
||||
outputs = will[wid].tx.outputs()
|
||||
ow=will[wid]
|
||||
ow.normalize_locktime(others_inputs)
|
||||
will[wid]=ow.to_dict()
|
||||
will[wid]=WillItem(ow.to_dict())
|
||||
|
||||
for i in range(0,len(outputs)):
|
||||
Will.change_input(will,wid,i,outputs[i],others_inputs,to_delete,to_add)
|
||||
@@ -319,7 +324,6 @@ class Will:
|
||||
locktime = Util.get_current_height(wallet.network)
|
||||
tx = PartialTransaction.from_io(utxo_to_spend, [out], locktime=locktime, version=2)
|
||||
tx.set_rbf(True)
|
||||
print("fees_per_byte:",fees_per_byte)
|
||||
fee=tx.estimated_size()*fees_per_byte
|
||||
if balance -fee >0:
|
||||
out = PartialTxOutput.from_address_and_value(change_addresses[0],balance - fee)
|
||||
|
||||
Reference in New Issue
Block a user