{"action":"created","comment":{"url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/comments/233266747","pull_request_review_id":174638970,"id":233266747,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzI2Njc0Nw==","diff_hunk":"@@ -4462,24 +4441,82 @@ mod tests {\n \t\tcheck_added_monitors!(nodes[1], 1);\n \t}\n \n+\t#[test]\n+\tfn test_update_fee_that_funder_cannot_afford() {\n+\t\tlet mut nodes = create_network(2);\n+\t\tlet chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1432, 200000);\n+\t\tlet channel_id = chan.2;\n+\n+\t\tlet feerate = 260;\n+\t\tnodes[0].node.update_fee(channel_id, feerate).unwrap();\n+\t\tcheck_added_monitors!(nodes[0], 1);\n+\n+\t\tlet events_0 = nodes[0].node.get_and_clear_pending_msg_events();\n+\t\tassert_eq!(events_0.len(), 1);\n+\t\tlet (update_msg, commitment_signed) = match events_0[0] {\n+\t\t\tMessageSendEvent::UpdateHTLCs {\n+\t\t\t\tnode_id: _, updates: msgs::CommitmentUpdate {","path":"src/ln/channelmanager.rs","position":133,"original_position":133,"commit_id":"81421750ce8dd8fe7d2c506dd1a0ab54328c716a","original_commit_id":"81421750ce8dd8fe7d2c506dd1a0ab54328c716a","user":{"login":"TheBlueMatt","id":649246,"node_id":"MDQ6VXNlcjY0OTI0Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/649246?v=4","gravatar_id":"","url":"https://api.github.com/users/TheBlueMatt","html_url":"https://github.com/TheBlueMatt","followers_url":"https://api.github.com/users/TheBlueMatt/followers","following_url":"https://api.github.com/users/TheBlueMatt/following{/other_user}","gists_url":"https://api.github.com/users/TheBlueMatt/gists{/gist_id}","starred_url":"https://api.github.com/users/TheBlueMatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheBlueMatt/subscriptions","organizations_url":"https://api.github.com/users/TheBlueMatt/orgs","repos_url":"https://api.github.com/users/TheBlueMatt/repos","events_url":"https://api.github.com/users/TheBlueMatt/events{/privacy}","received_events_url":"https://api.github.com/users/TheBlueMatt/received_events","type":"User","site_admin":false},"body":"Note that you can generally replace \"a_thing: _, b_thing\" with \"b_thing, ..\" to keep things shorter.","created_at":"2018-11-13T23:45:54Z","updated_at":"2018-11-13T23:52:51Z","html_url":"https://github.com/rust-bitcoin/rust-lightning/pull/231#discussion_r233266747","pull_request_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/comments/233266747"},"html":{"href":"https://github.com/rust-bitcoin/rust-lightning/pull/231#discussion_r233266747"},"pull_request":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231"}}},"pull_request":{"url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231","id":227342143,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3MzQyMTQz","html_url":"https://github.com/rust-bitcoin/rust-lightning/pull/231","diff_url":"https://github.com/rust-bitcoin/rust-lightning/pull/231.diff","patch_url":"https://github.com/rust-bitcoin/rust-lightning/pull/231.patch","issue_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/231","number":231,"state":"open","locked":false,"title":"Check funder can afford commitment transaction fee when receiving update_fee","user":{"login":"philipr-za","id":25514413,"node_id":"MDQ6VXNlcjI1NTE0NDEz","avatar_url":"https://avatars2.githubusercontent.com/u/25514413?v=4","gravatar_id":"","url":"https://api.github.com/users/philipr-za","html_url":"https://github.com/philipr-za","followers_url":"https://api.github.com/users/philipr-za/followers","following_url":"https://api.github.com/users/philipr-za/following{/other_user}","gists_url":"https://api.github.com/users/philipr-za/gists{/gist_id}","starred_url":"https://api.github.com/users/philipr-za/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipr-za/subscriptions","organizations_url":"https://api.github.com/users/philipr-za/orgs","repos_url":"https://api.github.com/users/philipr-za/repos","events_url":"https://api.github.com/users/philipr-za/events{/privacy}","received_events_url":"https://api.github.com/users/philipr-za/received_events","type":"User","site_admin":false},"body":"Issue https://github.com/rust-bitcoin/rust-lightning/issues/204\r\n\r\nWhen handling an update_fee message from the funder we must confirm that the funder can afford the new fee for the receiving nodes current commitment transaction.\r\n\r\nThis is my first PR so still new to the workings of Lightning and the architecture of rust-lightning so my reading of it is likely incorrect. I am not 100% sure about this but from my reading it seems that when a node handles a `commitment_signed` message it constructs a new local commitment and in that process calls `channel::build_commitment_transaction(...)` which runs through all the incoming and outgoing HTLCs and tests if they should be trimmed or not. The resulting untrimmed HTLC outputs are then pushed into the first position in the `channel.last_local_commitment_txn` vector. The length of the output field of that first transaction seems to be number of untrimmed HTLCs in the current local commitment?\r\n\r\nLooking forward to some feedback.\r\n","created_at":"2018-10-31T15:52:42Z","updated_at":"2018-11-13T23:52:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"742e0ff981d7b12700fef5e4f595ed5d28bae60c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231/commits","review_comments_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231/comments","review_comment_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/231/comments","statuses_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/statuses/81421750ce8dd8fe7d2c506dd1a0ab54328c716a","head":{"label":"philipr-za:philip-204-check-commitment-transaction-fee","ref":"philip-204-check-commitment-transaction-fee","sha":"81421750ce8dd8fe7d2c506dd1a0ab54328c716a","user":{"login":"philipr-za","id":25514413,"node_id":"MDQ6VXNlcjI1NTE0NDEz","avatar_url":"https://avatars2.githubusercontent.com/u/25514413?v=4","gravatar_id":"","url":"https://api.github.com/users/philipr-za","html_url":"https://github.com/philipr-za","followers_url":"https://api.github.com/users/philipr-za/followers","following_url":"https://api.github.com/users/philipr-za/following{/other_user}","gists_url":"https://api.github.com/users/philipr-za/gists{/gist_id}","starred_url":"https://api.github.com/users/philipr-za/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipr-za/subscriptions","organizations_url":"https://api.github.com/users/philipr-za/orgs","repos_url":"https://api.github.com/users/philipr-za/repos","events_url":"https://api.github.com/users/philipr-za/events{/privacy}","received_events_url":"https://api.github.com/users/philipr-za/received_events","type":"User","site_admin":false},"repo":{"id":153252305,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMyNTIzMDU=","name":"rust-lightning","full_name":"philipr-za/rust-lightning","private":false,"owner":{"login":"philipr-za","id":25514413,"node_id":"MDQ6VXNlcjI1NTE0NDEz","avatar_url":"https://avatars2.githubusercontent.com/u/25514413?v=4","gravatar_id":"","url":"https://api.github.com/users/philipr-za","html_url":"https://github.com/philipr-za","followers_url":"https://api.github.com/users/philipr-za/followers","following_url":"https://api.github.com/users/philipr-za/following{/other_user}","gists_url":"https://api.github.com/users/philipr-za/gists{/gist_id}","starred_url":"https://api.github.com/users/philipr-za/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipr-za/subscriptions","organizations_url":"https://api.github.com/users/philipr-za/orgs","repos_url":"https://api.github.com/users/philipr-za/repos","events_url":"https://api.github.com/users/philipr-za/events{/privacy}","received_events_url":"https://api.github.com/users/philipr-za/received_events","type":"User","site_admin":false},"html_url":"https://github.com/philipr-za/rust-lightning","description":"Rust-Lightning, not Rusty's Lightning","fork":true,"url":"https://api.github.com/repos/philipr-za/rust-lightning","forks_url":"https://api.github.com/repos/philipr-za/rust-lightning/forks","keys_url":"https://api.github.com/repos/philipr-za/rust-lightning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/philipr-za/rust-lightning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/philipr-za/rust-lightning/teams","hooks_url":"https://api.github.com/repos/philipr-za/rust-lightning/hooks","issue_events_url":"https://api.github.com/repos/philipr-za/rust-lightning/issues/events{/number}","events_url":"https://api.github.com/repos/philipr-za/rust-lightning/events","assignees_url":"https://api.github.com/repos/philipr-za/rust-lightning/assignees{/user}","branches_url":"https://api.github.com/repos/philipr-za/rust-lightning/branches{/branch}","tags_url":"https://api.github.com/repos/philipr-za/rust-lightning/tags","blobs_url":"https://api.github.com/repos/philipr-za/rust-lightning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/philipr-za/rust-lightning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/philipr-za/rust-lightning/git/refs{/sha}","trees_url":"https://api.github.com/repos/philipr-za/rust-lightning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/philipr-za/rust-lightning/statuses/{sha}","languages_url":"https://api.github.com/repos/philipr-za/rust-lightning/languages","stargazers_url":"https://api.github.com/repos/philipr-za/rust-lightning/stargazers","contributors_url":"https://api.github.com/repos/philipr-za/rust-lightning/contributors","subscribers_url":"https://api.github.com/repos/philipr-za/rust-lightning/subscribers","subscription_url":"https://api.github.com/repos/philipr-za/rust-lightning/subscription","commits_url":"https://api.github.com/repos/philipr-za/rust-lightning/commits{/sha}","git_commits_url":"https://api.github.com/repos/philipr-za/rust-lightning/git/commits{/sha}","comments_url":"https://api.github.com/repos/philipr-za/rust-lightning/comments{/number}","issue_comment_url":"https://api.github.com/repos/philipr-za/rust-lightning/issues/comments{/number}","contents_url":"https://api.github.com/repos/philipr-za/rust-lightning/contents/{+path}","compare_url":"https://api.github.com/repos/philipr-za/rust-lightning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/philipr-za/rust-lightning/merges","archive_url":"https://api.github.com/repos/philipr-za/rust-lightning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/philipr-za/rust-lightning/downloads","issues_url":"https://api.github.com/repos/philipr-za/rust-lightning/issues{/number}","pulls_url":"https://api.github.com/repos/philipr-za/rust-lightning/pulls{/number}","milestones_url":"https://api.github.com/repos/philipr-za/rust-lightning/milestones{/number}","notifications_url":"https://api.github.com/repos/philipr-za/rust-lightning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/philipr-za/rust-lightning/labels{/name}","releases_url":"https://api.github.com/repos/philipr-za/rust-lightning/releases{/id}","deployments_url":"https://api.github.com/repos/philipr-za/rust-lightning/deployments","created_at":"2018-10-16T08:42:28Z","updated_at":"2018-11-13T07:56:27Z","pushed_at":"2018-11-13T09:20:29Z","git_url":"git://github.com/philipr-za/rust-lightning.git","ssh_url":"git@github.com:philipr-za/rust-lightning.git","clone_url":"https://github.com/philipr-za/rust-lightning.git","svn_url":"https://github.com/philipr-za/rust-lightning","homepage":null,"size":1777,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-bitcoin:master","ref":"master","sha":"74f59a2177cbb3f79a34a44921a8d82cd306b7dd","user":{"login":"rust-bitcoin","id":37084147,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MDg0MTQ3","avatar_url":"https://avatars3.githubusercontent.com/u/37084147?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-bitcoin","html_url":"https://github.com/rust-bitcoin","followers_url":"https://api.github.com/users/rust-bitcoin/followers","following_url":"https://api.github.com/users/rust-bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/rust-bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-bitcoin/subscriptions","organizations_url":"https://api.github.com/users/rust-bitcoin/orgs","repos_url":"https://api.github.com/users/rust-bitcoin/repos","events_url":"https://api.github.com/users/rust-bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/rust-bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":121809370,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE4MDkzNzA=","name":"rust-lightning","full_name":"rust-bitcoin/rust-lightning","private":false,"owner":{"login":"rust-bitcoin","id":37084147,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MDg0MTQ3","avatar_url":"https://avatars3.githubusercontent.com/u/37084147?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-bitcoin","html_url":"https://github.com/rust-bitcoin","followers_url":"https://api.github.com/users/rust-bitcoin/followers","following_url":"https://api.github.com/users/rust-bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/rust-bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-bitcoin/subscriptions","organizations_url":"https://api.github.com/users/rust-bitcoin/orgs","repos_url":"https://api.github.com/users/rust-bitcoin/repos","events_url":"https://api.github.com/users/rust-bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/rust-bitcoin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rust-bitcoin/rust-lightning","description":"Rust-Lightning, not Rusty's Lightning","fork":false,"url":"https://api.github.com/repos/rust-bitcoin/rust-lightning","forks_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/forks","keys_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/teams","hooks_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/hooks","issue_events_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/events{/number}","events_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/events","assignees_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/assignees{/user}","branches_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/branches{/branch}","tags_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/tags","blobs_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/languages","stargazers_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/stargazers","contributors_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/contributors","subscribers_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/subscribers","subscription_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/subscription","commits_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/contents/{+path}","compare_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/merges","archive_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/downloads","issues_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues{/number}","pulls_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/labels{/name}","releases_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/releases{/id}","deployments_url":"https://api.github.com/repos/rust-bitcoin/rust-lightning/deployments","created_at":"2018-02-16T22:50:53Z","updated_at":"2018-11-13T22:50:58Z","pushed_at":"2018-11-13T22:50:55Z","git_url":"git://github.com/rust-bitcoin/rust-lightning.git","ssh_url":"git@github.com:rust-bitcoin/rust-lightning.git","clone_url":"https://github.com/rust-bitcoin/rust-lightning.git","svn_url":"https://github.com/rust-bitcoin/rust-lightning","homepage":null,"size":1863,"stargazers_count":133,"watchers_count":133,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":30,"open_issues":43,"watchers":133,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231"},"html":{"href":"https://github.com/rust-bitcoin/rust-lightning/pull/231"},"issue":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/231"},"comments":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/issues/231/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/pulls/231/commits"},"statuses":{"href":"https://api.github.com/repos/rust-bitcoin/rust-lightning/statuses/81421750ce8dd8fe7d2c506dd1a0ab54328c716a"}},"author_association":"NONE"}}
{"actor":{"display_login":"TheBlueMatt"}}