From 5fa2a48343be7253497bb96ad70d091011ef4389 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 12 May 2015 12:30:26 +0200 Subject: [PATCH] add getmerkle command --- lib/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/commands.py b/lib/commands.py index bccf49872..9626d6088 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -107,7 +107,8 @@ register_command('verifymessage', 3,-1, False, False, False, 'Verifies a register_command('encrypt', 2,-1, False, False, False, 'encrypt a message with pubkey','encrypt ') register_command('decrypt', 2,-1, False, True, True, 'decrypt a message encrypted with pubkey','decrypt ') -register_command('getproof', 1, 1, True, False, False, 'get merkle proof', 'getproof
') +register_command('getmerkle', 2, 2, True, False, False, 'Get Merkle branch of a transaction included in a block', 'getmerkle ') +register_command('getproof', 1, 1, True, False, False, 'Get Merkle branch of an address in the UTXO set', 'getproof
') register_command('getutxoaddress', 2, 2, True, False, False, 'get the address of an unspent transaction output','getutxoaddress ') register_command('sweep', 2, 3, True, False, False, 'Sweep a private key.', 'sweep privkey addr [fee]') register_command('make_seed', 3, 3, False, False, False, 'Create a seed.','options: --nbits --entropy --lang') @@ -254,6 +255,9 @@ class Commands: out.append(i) return out + def getmerkle(self, txid, height): + return self.network.synchronous_get([ ('blockchain.transaction.get_merkle', [txid, int(height)]) ])[0] + def getservers(self): while not self.network.is_up_to_date(): time.sleep(0.1)