Decred: Add proxy config when using tor.

This commit is contained in:
tecnovert
2024-05-25 11:22:12 +02:00
parent 73b4b2a46b
commit 62aa1fa5d7
5 changed files with 31 additions and 9 deletions

View File

@@ -228,6 +228,13 @@ class DCRInterface(Secp256k1Interface):
return secondsLocked | SEQUENCE_LOCKTIME_TYPE_FLAG
raise ValueError('Unknown lock type')
@staticmethod
def decodeSequence(lock_value: int) -> int:
# Return the raw value
if lock_value & SEQUENCE_LOCKTIME_TYPE_FLAG:
return (lock_value & SEQUENCE_LOCKTIME_MASK) << SEQUENCE_LOCKTIME_GRANULARITY
return lock_value & SEQUENCE_LOCKTIME_MASK
@staticmethod
def watch_blocks_for_scripts() -> bool:
return True

View File

@@ -233,7 +233,7 @@
<input class="pl-10 hover:border-blue-500 pl-10 bg-gray-50 text-gray-900 appearance-none pr-10 dark:bg-gray-500 dark:text-white border border-gray-300 dark:border-gray-400 dark:text-gray-50 dark:placeholder-white text-sm rounded-lg outline-none focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 focus:ring-0" type="text" id="rate" name="rate" value="{{ data.rate }}" onchange="set_rate('rate');">
</div>
<div class="text-sm mt-2">
<a href="" id="get_rate_inferred_button" class="mt-2 dark:text-white bold text-coolGray-800">Get Rate Inferred:<span id="rate_inferred_display"></span></a>
<a href="" id="get_rate_inferred_button" class="mt-2 dark:text-white bold text-coolGray-800">Get Rate Inferred:</a><span class="dark:text-white" id="rate_inferred_display"></span>
</div>
<div class="flex form-check form-check-inline mt-5">
<div class="flex items-center h-5"> <input class="form-check-input hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="rate_lock" name="rate_lock" value="rl" checked=checked> </div>

View File

@@ -11,11 +11,11 @@ def decode_compactsize(b: bytes, offset: int = 0) -> (int, int):
return i, 1
offset += 1
if i == 0xfd:
return int.from_bytes(b[offset: offset + 2]), 3
return int.from_bytes(b[offset: offset + 2], 'little'), 3
if i == 0xfe:
return int.from_bytes(b[offset: offset + 4]), 5
return int.from_bytes(b[offset: offset + 4], 'little'), 5
# 0xff
return int.from_bytes(b[offset: offset + 8]), 9
return int.from_bytes(b[offset: offset + 8], 'little'), 9
def encode_compactsize(i: int) -> bytes: