Matt Corallo
68e6beab7c
Expose the script_pubkey being monitored in chain watch ( fixes #44 )
2018-07-19 22:22:14 -04:00
Matt Corallo
b02176c86b
Fix various spec bugs, can now open channels with real nodes!
...
* commitment transaction number, as used in locktime/sequence
fields is actually different from commitment transaction number,
as used for revocation state. This is confusing and never stated
in the spec, so we have to do the conversion.
* max_htlc_value_in_flight is never constrained in the spec, but
we were requiring it be <= channel size. Instead just clamp the
values the peer sends us when storing.
* channel_id calculation was incorrect, we now do some crazy
conversion hops, which we shouldn't, but will need to change our
types to fix.
* Our channel_reserve_satoshis value was too low, just change the
constant and leave the TODO to figure out what it really should
be for now.
2018-07-19 17:25:47 -04:00
Matt Corallo
73932d75dc
Merge pull request #49 from ariard/bad_failure_codes
...
Erroneous failure codes, replace PERM|7 by UPDATE|7
2018-07-18 16:55:06 -04:00
Matt Corallo
4f644f225c
Fix channelmonitor fuzz test failure
2018-07-18 13:36:31 -04:00
Antoine Riard
584ad11c1d
Erroneous failure codes, replace PERM|7 by UPDATE|7
2018-07-18 02:47:54 +00:00
Matt Corallo
0b82f5584f
Test channelmonitor serialization roundtrip doesn't mutate state
2018-07-17 14:59:29 -04:00
Matt Corallo
0553945e21
Implement channelmonitor (de)serialization ( fixes #45 )
2018-07-17 14:39:50 -04:00
Matt Corallo
9df3053575
Clarify ChannelMonitor remote commitment tracking and fix a race
2018-07-17 12:47:54 -04:00
Matt Corallo
a48fd6ddfa
Move channelmonitor-update functions to pub(ln) from pub
2018-07-17 12:47:54 -04:00
Antoine Riard
f5b48104dd
TODO already cleaned by #16
2018-07-13 02:51:45 +00:00
Matt Corallo
c47525cb84
Move open_channel message handling into an event
...
This simplifies client usage cause peer_handler doesn't have an
interface to shove arbitrary messages in.
2018-07-06 17:31:01 -04:00
Matt Corallo
e98e1e2fdc
Add warning about aut-close()-fd-races for peer_handler impls
2018-07-03 11:26:49 -04:00
Jean Pierre Dudey
6707db6eae
Add MAX_FUNDING_SATOSHIS
constant.
...
This constants defines the maximum value of `open_channel.funding_satoshis`,
currently it's defined to be 2^24 according to the BOLT #2 specification.
Also a test was added to check that the constant is never over 2,1x10^15
(maximum satoshis in bitcoin) if modified.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-06-30 11:13:18 -04:00
Matt Corallo
5fa80d022a
Merge pull request #37 from TheBlueMatt/master
...
Fix additional 1.22 rustc warning
2018-06-29 18:26:41 -04:00
Matt Corallo
5918df8490
Merge pull request #36 from TheBlueMatt/2018-08-33-cleanups
...
Cleanups after #33 , plus one unrelated bugfix spotted in #33 review
2018-06-29 18:26:25 -04:00
Matt Corallo
1228663b3e
Fix additional 1.22 rustc warning
2018-06-29 17:44:55 -04:00
Matt Corallo
d62abad028
Add more docs to transaction::OutPoint
2018-06-29 17:38:05 -04:00
Matt Corallo
56842c2bea
Cleanups after #33 , plus one unrelated bugfix spotted in #33 review
2018-06-29 17:23:50 -04:00
Matt Corallo
98e5c5e4d3
Merge pull request #35 from TheBlueMatt/2018-06-post-32
...
Some cleanups after #32
2018-06-29 17:23:43 -04:00
Matt Corallo
b65aa86ea0
Merge pull request #33 from jeandudey/funding_txo
...
Use the `TxOutRef` type for the `ChannelMonitor`'s funding_txo field.
2018-06-29 17:23:34 -04:00
Matt Corallo
844097ec01
Greatly simplify channelmonitor pruning tests, and use real funcs
...
Instead of hooking into internal data structures and modifying
those, call the actual functions Channel will call and then check
that the preimages map is correct.
2018-06-29 17:02:51 -04:00
Matt Corallo
8926c25f53
Also avoid pruning preimages for previous local tx in ChannelMonitor
2018-06-29 16:44:19 -04:00
Matt Corallo
f5225a18b7
Fix chan_utils indentation issue
2018-06-29 16:44:19 -04:00
Matt Corallo
aec0fa485c
A few minor test cleanups and remove new warnings from #32
2018-06-29 16:44:19 -04:00
Matt Corallo
04b0acc9dc
Skip some a needless temporary vec and clean indentation after #32
2018-06-29 16:44:19 -04:00
Matt Corallo
f9ec0a76d4
Merge pull request #32 from ariard/prune_payment_preimages
...
Add pruning of preimages no longer needed + tests
2018-06-29 16:43:56 -04:00
Jean Pierre Dudey
d0e9137bc5
Add the OutPoint
type for the ChannelMonitor
's funding_txo field.
...
This structure replaces the (Sha256dHash, u16) tuple that was being used
for the funding output.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-06-29 12:12:17 -04:00
Antoine Riard
ef166420b0
Add pruning of preimages no longer needed + tests
2018-06-28 23:19:24 +00:00
Matt Corallo
deedc69a64
Fix Pong response attempt-to-encode-oversize-msg panic
2018-06-27 17:00:05 -04:00
Matt Corallo
e3effa4622
Send initial_routing_sync-filled Init messages to the first 5 peers
2018-06-16 19:46:49 -04:00
Matt Corallo
05e2a7dc48
Support responding to Ping messages in peer_handler
2018-06-16 19:46:49 -04:00
Matt Corallo
33771194d8
Work around lnd sending invalid messages
2018-06-16 19:45:32 -04:00
Matt Corallo
d7b33fcd84
Support ignoring some errors, deserialize empty flags types
2018-06-16 19:45:32 -04:00
Matt Corallo
0595dbee37
Make PeerHandleError Error impl public
2018-06-14 18:05:13 -04:00
Matt Corallo
738638fad4
Remove bitcoincorerpcchain, as it belongs in a separate crate
2018-06-14 18:05:13 -04:00
Matt Corallo
5481a5d653
Provide Send + Sync on message handlers (just changes trait)
2018-06-14 18:05:13 -04:00
Matt Corallo
f462d8ac70
fuzztarget sha -> XOR, crates secp256k1
2018-06-04 20:02:07 -04:00
Yuntai Kyong
fb1bf30263
filling unimplemented!() for many messages' encoding/decoding routines
2018-05-12 14:30:26 +09:00
Matt Corallo
22342134ef
Some with_capacity's
2018-04-26 19:45:36 -04:00
Matt Corallo
a20eef17c9
Fix local route update broadcasts, annouce channel closures
2018-04-24 20:42:24 -04:00
Matt Corallo
2d8afeccdb
Rewrite channelmonitor framework and implement a bunch of it
2018-04-24 20:42:24 -04:00
Matt Corallo
7400b3bb7c
Fix some channel remove channelmanager consistency bugs
2018-04-24 16:01:14 -04:00
Matt Corallo
8e2974fc2a
HTLC Failure message handling
2018-04-24 11:55:08 -04:00
Matt Corallo
53d1518566
Move ChannelKeys creation into channelmanager
2018-04-17 12:43:12 -04:00
Matt Corallo
1ec9c3aa4b
Provide fallback for crypto's fixed_time_eq on non-x86/arm targets
2018-04-16 20:35:21 -04:00
Matt Corallo
4d75d4c099
Minor cleanups
2018-04-16 20:35:21 -04:00
Matt Corallo
f5ca346011
Fix commitment transaction number/per_commitment_point tracking
2018-04-16 20:35:21 -04:00
Matt Corallo
0940db25ec
Refactor channelmanager network tests significantly
2018-04-16 20:35:21 -04:00
Matt Corallo
e9f9cda986
impl more message encodings
2018-04-16 20:35:21 -04:00
Matt Corallo
374ea1f05e
Completely rewrite channel HTLC tracking and processing
...
It obviously was nonsensical prior, though its now way more
complicated...there's refactoring work to be done here, but it
should at least kinda sorta work now.
2018-04-16 20:35:21 -04:00