-
Notifications
You must be signed in to change notification settings - Fork 1k
Move max funding and payment values to chainparams #1842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
83e6342
da33fc2
e2356d2
97a291d
f152fac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,8 +143,10 @@ static const struct htlc **include_htlcs(struct channel *channel, enum side side | |
|
|
||
| memset(&preimage, i, sizeof(preimage)); | ||
| sha256(&hash, &preimage, sizeof(preimage)); | ||
| e = channel_add_htlc(channel, sender, i, msatoshi, 500+i, &hash, | ||
| dummy_routing, NULL); | ||
| e = channel_add_htlc(channel, | ||
| &chainparams_by_index(0)->genesis_blockhash, | ||
| sender, i, msatoshi, 500+i, | ||
| &hash, dummy_routing, NULL); | ||
| assert(e == CHANNEL_ERR_ADD_OK); | ||
| htlcs[i] = channel_get_htlc(channel, sender, i); | ||
| } | ||
|
|
@@ -235,8 +237,10 @@ static void send_and_fulfill_htlc(struct channel *channel, | |
| memset(&r, 0, sizeof(r)); | ||
| sha256(&rhash, &r, sizeof(r)); | ||
|
|
||
| assert(channel_add_htlc(channel, sender, 1337, msatoshi, 900, &rhash, | ||
| dummy_routing, NULL) == CHANNEL_ERR_ADD_OK); | ||
| assert(channel_add_htlc(channel, | ||
| &chainparams_by_index(0)->genesis_blockhash, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This index needs to be pulled out into a |
||
| sender, 1337, msatoshi, 900, | ||
| &rhash, dummy_routing, NULL) == CHANNEL_ERR_ADD_OK); | ||
|
|
||
| changed_htlcs = tal_arr(channel, const struct htlc *, 0); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,12 +29,4 @@ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id); | |
| * the network, as detailed within [BOLT #7] | ||
| */ | ||
| #define CHANNEL_FLAGS_ANNOUNCE_CHANNEL 1 | ||
|
|
||
| /* BOLT #2: | ||
| * | ||
| * The sending node: | ||
| *... | ||
| * - MUST set `funding_satoshis` to less than 2^24 satoshi. | ||
| */ | ||
| #define MAX_FUNDING_SATOSHI ((1 << 24) - 1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dislike removing spec quotes (our build checks they're valid, so if spec changes we know where to fix): can we move this into chainparams.c, and then use this value there? |
||
| #endif /* LIGHTNING_WIRE_PEER_WIRE_H */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is being checked here at all. The
chain_hashis channel-specific, and the chain is implicitly communicated through the channel that is being updated, so we should not be passing this down here at all.