From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Fri, 18 Jun 2021 18:06:45 +0000 (+0000) Subject: Merge pull request #956 from jkczyz/2021-06-validate-pub X-Git-Tag: v0.0.99~21 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4d1c1a32f20dcce2553ba7ec467e349fc37493c8;hp=7302c8c38a748a5fb991d142a997b9ffd1d57248;p=rust-lightning Merge pull request #956 from jkczyz/2021-06-validate-pub Increase poll::Validate visibility to pub --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d24b2be7..716d4b0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,9 @@ jobs: check_commits: runs-on: ubuntu-latest env: - TOOLCHAIN: stable + # rustc 1.53 regressed and panics when building our (perfectly fine) docs. + # See https://github.com/rust-lang/rust/issues/84738 + TOOLCHAIN: 1.52.1 steps: - name: Checkout source code uses: actions/checkout@v2 diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index fa6a8eed..2ce58f29 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -60,12 +60,16 @@ const MAX_EXPIRY_TIME: u64 = 60 * 60 * 24 * 356; /// Default expiry time as defined by [BOLT 11]. /// /// [BOLT 11]: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md -const DEFAULT_EXPIRY_TIME: u64 = 3600; +pub const DEFAULT_EXPIRY_TIME: u64 = 3600; /// Default minimum final CLTV expiry as defined by [BOLT 11]. /// +/// Note that this is *not* the same value as rust-lightning's minimum CLTV expiry, which is +/// provided in [`MIN_FINAL_CLTV_EXPIRY`]. +/// /// [BOLT 11]: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md -const DEFAULT_MIN_FINAL_CLTV_EXPIRY: u64 = 18; +/// [`MIN_FINAL_CLTV_EXPIRY`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY +pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY: u64 = 18; /// This function is used as a static assert for the size of `SystemTime`. If the crate fails to /// compile due to it this indicates that your system uses unexpected bounds for `SystemTime`. You diff --git a/lightning/src/util/message_signing.rs b/lightning/src/util/message_signing.rs index c39da1d5..69c802e7 100644 --- a/lightning/src/util/message_signing.rs +++ b/lightning/src/util/message_signing.rs @@ -12,13 +12,13 @@ //! Note this is not part of the specs, but follows lnd's signing and verifying protocol, which can is defined as follows: //! //! signature = zbase32(SigRec(sha256d(("Lightning Signed Message:" + msg))) -//! zbase32 from https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt +//! zbase32 from //! SigRec has first byte 31 + recovery id, followed by 64 byte sig. //! //! This implementation is compatible with both lnd's and c-lightning's //! -//! https://lightning.readthedocs.io/lightning-signmessage.7.html -//! https://api.lightning.community/#signmessage +//! +//! use prelude::*; use crate::util::zbase32;