Skip to content

Commit 596e2ce

Browse files
committed
Move extern C stuff to bottom of file
The C function declarations can go at the bottom, based on the principle of putting the most important stuff at the top. Refactor only, no logic changes.
1 parent 7c1cb29 commit 596e2ce

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/lib.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,6 @@ pub const VERIFY_ALL: c_uint = VERIFY_P2SH
4141
| VERIFY_CHECKSEQUENCEVERIFY
4242
| VERIFY_WITNESS;
4343

44-
extern "C" {
45-
/// Returns `libbitcoinconsensus` version.
46-
pub fn bitcoinconsensus_version() -> c_int;
47-
48-
/// Verifies that the transaction input correctly spends the previous
49-
/// output, considering any additional constraints specified by flags.
50-
pub fn bitcoinconsensus_verify_script_with_amount(
51-
script_pubkey: *const c_uchar,
52-
script_pubkeylen: c_uint,
53-
amount: u64,
54-
tx_to: *const c_uchar,
55-
tx_tolen: c_uint,
56-
n_in: c_uint,
57-
flags: c_uint,
58-
err: *mut Error,
59-
) -> c_int;
60-
}
61-
6244
/// Computes flags for soft fork activation heights on the Bitcoin network.
6345
pub fn height_to_flags(height: u32) -> u32 {
6446
let mut flag = VERIFY_NONE;
@@ -156,6 +138,24 @@ pub fn verify_with_flags(
156138
}
157139
}
158140

141+
extern "C" {
142+
/// Returns `libbitcoinconsensus` version.
143+
pub fn bitcoinconsensus_version() -> c_int;
144+
145+
/// Verifies that the transaction input correctly spends the previous
146+
/// output, considering any additional constraints specified by flags.
147+
pub fn bitcoinconsensus_verify_script_with_amount(
148+
script_pubkey: *const c_uchar,
149+
script_pubkeylen: c_uint,
150+
amount: u64,
151+
tx_to: *const c_uchar,
152+
tx_tolen: c_uint,
153+
n_in: c_uint,
154+
flags: c_uint,
155+
err: *mut Error,
156+
) -> c_int;
157+
}
158+
159159
/// Errors returned by [`libbitcoinconsensus`].
160160
///
161161
/// The error variant identifiers mimic those from `libbitcoinconsensus`.

0 commit comments

Comments
 (0)