tlnwatcher: store transactions as binary - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 02d013421abc3066cea3c7a3076cc81255f090e7
DIR parent d8e9a9a49e38fb9353fb80b3d72debc0ccd711ce
HTML Author: ThomasV <thomasv@electrum.org>
Date: Wed, 6 Mar 2019 10:51:24 +0100
lnwatcher: store transactions as binary
Diffstat:
M electrum/lnrouter.py | 1 -
M electrum/lnwatcher.py | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
---
DIR diff --git a/electrum/lnrouter.py b/electrum/lnrouter.py
t@@ -219,7 +219,6 @@ class ChannelDB(SqlDB):
def __init__(self, network: 'Network'):
path = os.path.join(get_headers_dir(network.config), 'channel_db')
super().__init__(network, path, Base)
- print(Base)
self.num_nodes = 0
self.num_channels = 0
self._channel_updates_for_private_channels = {} # type: Dict[Tuple[bytes, bytes], dict]
DIR diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py
t@@ -65,7 +65,7 @@ class SweepStore(SqlDB):
@sql
def get_sweep_tx(self, funding_outpoint, prev_txid):
- return [Transaction(r.tx) for r in self.DBSession.query(SweepTx).filter(SweepTx.funding_outpoint==funding_outpoint, SweepTx.prev_txid==prev_txid).all()]
+ return [Transaction(bh2u(r.tx)) for r in self.DBSession.query(SweepTx).filter(SweepTx.funding_outpoint==funding_outpoint, SweepTx.prev_txid==prev_txid).all()]
@sql
def list_sweep_tx(self):
t@@ -73,7 +73,7 @@ class SweepStore(SqlDB):
@sql
def add_sweep_tx(self, funding_outpoint, prev_txid, tx):
- self.DBSession.add(SweepTx(funding_outpoint=funding_outpoint, prev_txid=prev_txid, tx=str(tx), txid=tx.txid()))
+ self.DBSession.add(SweepTx(funding_outpoint=funding_outpoint, prev_txid=prev_txid, tx=bfh(str(tx)), txid=tx.txid()))
self.DBSession.commit()
@sql