1
0

coinchooser: "privacy" policy now prefers confirmed coins. removed "priority" policy.

This commit is contained in:
SomberNight
2017-12-11 14:48:59 +01:00
parent 4e4a7746fc
commit 2a3c41b24f
4 changed files with 85 additions and 53 deletions

View File

@@ -877,6 +877,13 @@ class Transaction:
return 4 * input_size + witness_size
@classmethod
def estimated_output_size(cls, address):
"""Return an estimate of serialized output size in bytes."""
script = bitcoin.address_to_script(address)
# 8 byte value + 1 byte script len + script
return 9 + len(script) // 2
@classmethod
def virtual_size_from_weight(cls, weight):
return weight // 4 + (weight % 4 > 0)