mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
Add flag --skipmerklecheck (#4957)
The --skipmerklecheck optional flag makes Electrum tolerate invalid merkle proofs from the server. This is useful for building Electrum servers that need a minimum amount of storage, though of course users should only enable it if they completely trust the connected server.
This commit is contained in:
parent
0caf8e30cd
commit
d5c8a0e0d0
2 changed files with 6 additions and 2 deletions
|
@ -909,6 +909,7 @@ def add_network_options(parser):
|
|||
parser.add_argument("-s", "--server", dest="server", default=None, help="set server host:port:protocol, where protocol is either t (tcp) or s (ssl)")
|
||||
parser.add_argument("-p", "--proxy", dest="proxy", default=None, help="set proxy [type:]host[:port], where type is socks4,socks5 or http")
|
||||
parser.add_argument("--noonion", action="store_true", dest="noonion", default=None, help="do not try to connect to onion servers")
|
||||
parser.add_argument("--skipmerklecheck", action="store_true", dest="skipmerklecheck", default=False, help="Tolerate invalid merkle proofs from server")
|
||||
|
||||
def add_global_options(parser):
|
||||
group = parser.add_argument_group('global options')
|
||||
|
|
|
@ -116,8 +116,11 @@ class SPV(NetworkJobOnDefaultServer):
|
|||
try:
|
||||
verify_tx_is_in_block(tx_hash, merkle_branch, pos, header, tx_height)
|
||||
except MerkleVerificationFailure as e:
|
||||
self.print_error(str(e))
|
||||
raise GracefulDisconnect(e)
|
||||
if self.network.config.get("skipmerklecheck"):
|
||||
self.print_error("skipping merkle proof check %s" % tx_hash)
|
||||
else:
|
||||
self.print_error(str(e))
|
||||
raise GracefulDisconnect(e)
|
||||
# we passed all the tests
|
||||
self.merkle_roots[tx_hash] = header.get('merkle_root')
|
||||
try: self.requested_merkle.remove(tx_hash)
|
||||
|
|
Loading…
Add table
Reference in a new issue