Commit Graph

8234 Commits

Author SHA1 Message Date
Matt Corallo
83e3d67b79
Merge pull request #74 from TheBlueMatt/2018-07-shutdown-event
Move shutdown sending to an event
2018-07-22 23:44:55 -04:00
Savil Srivastava
0c1f47807a [msgs::ChannelReestablish] implement encoding and decoding
Summary:

Implementing these, taking inspiration from the surrounding code since i'm a rust n00b.

Test Plan:
```
cargo build
cargo test channel_reestablish
```
output:
```
running 3 tests
test ln::msgs::tests::encoding_channel_reestablish_with_secret ... ok
test ln::msgs::tests::decode_channel_reestablish_bad_length ... ok
test ln::msgs::tests::encoding_channel_reestablish_no_secret ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 14 filtered out
```
2018-07-22 23:26:47 -04:00
Matt Corallo
add1d9d9e5
Merge pull request #69 from savil/gen-target-fix
[fuzz] remove \L in sed regex for filenames in gen_target.sh
2018-07-22 23:25:30 -04:00
Matt Corallo
7b4f382e26 Move shutdown sending to an event 2018-07-22 23:22:15 -04:00
Matt Corallo
12583b63af
Merge pull request #73 from TheBlueMatt/2018-07-no-uint
Migrate all Uint256s used for channel_ids to [u8; 32]
2018-07-22 19:41:12 -04:00
Matt Corallo
e93c9fbeaf Migrate all Uint256s used for channel_ids to [u8; 32] 2018-07-22 18:55:20 -04:00
Matt Corallo
456323886b
Merge pull request #71 from TheBlueMatt/2018-07-watch-funding
Ensure the funding transaction is registered to be monitored
2018-07-22 17:54:50 -04:00
Matt Corallo
896f5b8d91 Fix failure sending FundingLocked for non-announced channels 2018-07-22 17:11:20 -04:00
Matt Corallo
88c301cf08 Test transaction watch registration in channelmonitor tests 2018-07-22 13:59:11 -04:00
Matt Corallo
a611ae4741 Ensure the funding transaction is registered to be monitored 2018-07-22 13:59:11 -04:00
Matt Corallo
27476d28b8
Merge pull request #70 from TheBlueMatt/master
Clarify get_peer_node_ids docs a bit
2018-07-22 13:39:27 -04:00
Matt Corallo
951c1d4145 Clarify get_peer_node_ids docs a bit 2018-07-22 13:11:58 -04:00
Matt Corallo
c3362a122e
Merge pull request #67 from yuntai/issue_56
#56 Expose list of pubkeys of connected peers from PeerHandler and addresses-by-pubkey from Router
2018-07-22 13:08:49 -04:00
Yuntai Kyong
9679f708dc add two methods for the issue #56
peer_handler::get_peer_node_ids() get connected peers' node_id
router::get_addresses() to get network addresses by node_id
2018-07-22 15:19:20 +09:00
Savil Srivastava
dee4ce5171 [fuzz] remove \L in sed regex for filenames in gen_target.sh
Summary:
on `master` branch, if i ran `gen_target.sh` i would get the following output:
https://gist.github.com/savil/2b3114eaf34c3ef8499b65005e374841

Without it, I get the files generated that are already checked-in (as expected).

Looking at the sed docs (https://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html) i don't see an explanation for what `\L` may do in whatever regex sed follows. Does this look correct? cc @yuntai
2018-07-20 23:00:31 -07:00
Matt Corallo
372a80308b
Merge pull request #65 from TheBlueMatt/master
Bump version for API overhauls, update deps and docs
2018-07-19 23:31:37 -04:00
Matt Corallo
4afb0d85fa
Merge pull request #53 from savil/rename-error-msg-to-action
[HandleError] rename msg field to action
2018-07-19 23:30:28 -04:00
Matt Corallo
84cb40f859 Bump version for API overhauls, update deps and docs 2018-07-19 23:06:36 -04:00
Matt Corallo
de523c4ca3
Merge pull request #47 from ariard/block_disconnected_close_chan
Implement channel closing for block_disconnected on ChainListener + test
2018-07-19 23:05:22 -04:00
Savil Srivastava
14c02c0652 update TODO message for renaming "msg" field of HandleError struct 2018-07-19 20:01:55 -07:00
Savil Srivastava
fd141bbed2 [Error] rename msg field to action
this was a TODO and also briefly discussed in https://github.com/rust-bitcoin/rust-lightning/pull/43#pullrequestreview-135649551

I'm not fully sure how to remove the `Option`, and make it completely required. Would love suggestions. So, have omitted that for now. Plus, better to make smaller, incremental changes.

Test Plan:
`cargo build`
`cargo test`
2018-07-19 20:01:55 -07:00
Matt Corallo
7098ca3375 Make some more things pub(crate) as they don't need exposed now 2018-07-19 22:54:45 -04:00
Matt Corallo
89167164da
Merge pull request #64 from TheBlueMatt/master
Expose the script_pubkey being monitored in chain watch (fixes #44)
2018-07-19 22:44:42 -04:00
Antoine Riard
1b8544fd5d Implement channel closing for block_disconnected on ChainListener + test 2018-07-20 02:37:05 +00:00
Matt Corallo
11bf5bebf2 Remove in-repo TODOs (they're now tracked in GitHub) 2018-07-19 22:22:14 -04:00
Matt Corallo
68e6beab7c Expose the script_pubkey being monitored in chain watch (fixes #44) 2018-07-19 22:22:14 -04:00
Matt Corallo
5170fc95d8
Merge pull request #52 from TheBlueMatt/master
Fix various spec bugs, can now open channels with real nodes!
2018-07-19 17:48:58 -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
f22ff22b8a
Merge pull request #51 from TheBlueMatt/master
Shorten channelmonitor_deserialize_target's name for AFL
2018-07-18 15:00:49 -04:00
Matt Corallo
77a96366ba Shorten channelmonitor_deserialize_target's name for AFL 2018-07-18 14:36:48 -04:00
Matt Corallo
220a3e9740
Merge pull request #50 from TheBlueMatt/master
Fix channelmonitor fuzz test failure
2018-07-18 14:30:00 -04:00
Matt Corallo
4f644f225c Fix channelmonitor fuzz test failure 2018-07-18 13:36:31 -04:00
Matt Corallo
155f2ef188
Merge pull request #48 from TheBlueMatt/2018-07-monitor-serialize
Implement channelmonitor (de)serialization
2018-07-18 06:53:15 -07: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
Matt Corallo
17eecb3e6f Update TODOs in README 2018-07-17 12:47:54 -04:00
Matt Corallo
55f5ce0474
Merge pull request #46 from ariard/useless_todo_channelmanager
TODO already cleaned by #16
2018-07-13 21:30:22 -07:00
Antoine Riard
f5b48104dd TODO already cleaned by #16 2018-07-13 02:51:45 +00:00
Matt Corallo
48b0d99b96
Merge pull request #41 from TheBlueMatt/master
Move open_channel message handling into an event
2018-07-06 17:54:01 -04: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
f718af1a41
Merge pull request #39 from TheBlueMatt/master
Add warning about aut-close()-fd-races for peer_handler impls
2018-07-04 23:17:44 -04:00
Matt Corallo
e98e1e2fdc Add warning about aut-close()-fd-races for peer_handler impls 2018-07-03 11:26:49 -04:00
Matt Corallo
a426062a72
Merge pull request #38 from jeandudey/max-funding-satoshis
Add `MAX_FUNDING_SATOSHIS` constant.
2018-06-30 16:54:13 -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