diff --git a/lib/lnbase.py b/lib/lnbase.py index a7b6c34ef..e9d4da077 100644 --- a/lib/lnbase.py +++ b/lib/lnbase.py @@ -625,7 +625,7 @@ class Peer(PrintError): rn_l, rk_l = self.rn() rn_m, rk_m = self.rn() while True: - s = await self.reader.read(2**10) + s = await self.reader.read(1) if not s: raise Exception('connection closed') self.read_buffer += s @@ -851,7 +851,8 @@ class Peer(PrintError): delayed_payment_basepoint=local_config.delayed_basepoint.pubkey, first_per_commitment_point=per_commitment_point_first, to_self_delay=local_config.to_self_delay, - max_htlc_value_in_flight_msat=local_config.max_htlc_value_in_flight_msat + max_htlc_value_in_flight_msat=local_config.max_htlc_value_in_flight_msat, + channel_reserve_satoshis=10 ) self.send_message(msg) try: diff --git a/lib/tests/test_lnbase_online.py b/lib/tests/test_lnbase_online.py index ee09d2f64..7fcd2a8cb 100644 --- a/lib/tests/test_lnbase_online.py +++ b/lib/tests/test_lnbase_online.py @@ -136,14 +136,14 @@ if __name__ == "__main__": payment_hash = addr.paymenthash pubkey = addr.pubkey.serialize() amt = int(addr.amount * COIN) - advanced_channel = await peer.pay(wallet, openchannel, amt, payment_hash, pubkey, addr.min_final_cltv_expiry) + openchannel = await peer.pay(wallet, openchannel, amt, payment_hash, pubkey, addr.min_final_cltv_expiry) elif "get_paid" in sys.argv[1]: expected_received_sat = 200000 pay_req = lnencode(LnAddr(RHASH, amount=1/Decimal(COIN)*expected_received_sat, tags=[('d', 'one cup of coffee')]), peer.privkey[:32]) print("payment request", pay_req) - advanced_channel = await peer.receive_commitment_revoke_ack(openchannel, expected_received_sat, payment_preimage) + openchannel = await peer.receive_commitment_revoke_ack(openchannel, expected_received_sat, payment_preimage) - dumped = serialize_channels([advanced_channel]) + dumped = serialize_channels([openchannel]) wallet.storage.put("channels", dumped) wallet.storage.write() fut = asyncio.run_coroutine_threadsafe(async_test(), network.asyncio_loop)