wallet_db: WalletDB.get_txo_addr now returns dict instead of list
This commit is contained in:
@@ -794,12 +794,12 @@ class WalletDB(JsonDB):
|
||||
return list(d.items())
|
||||
|
||||
@locked
|
||||
def get_txo_addr(self, tx_hash: str, address: str) -> Iterable[Tuple[int, int, bool]]:
|
||||
"""Returns an iterable of (output_index, value, is_coinbase)."""
|
||||
def get_txo_addr(self, tx_hash: str, address: str) -> Dict[int, Tuple[int, bool]]:
|
||||
"""Returns a dict: output_index -> (value, is_coinbase)."""
|
||||
assert isinstance(tx_hash, str)
|
||||
assert isinstance(address, str)
|
||||
d = self.txo.get(tx_hash, {}).get(address, {})
|
||||
return [(int(n), v, cb) for (n, (v, cb)) in d.items()]
|
||||
return {int(n): (v, cb) for (n, (v, cb)) in d.items()}
|
||||
|
||||
@modifier
|
||||
def add_txi_addr(self, tx_hash: str, addr: str, ser: str, v: int) -> None:
|
||||
|
||||
Reference in New Issue
Block a user