Skip to content

Commit 78b4598

Browse files
committed
[bindings] Make Transaction::data *mut instead of *const
When the only reference to the transaction bytes is via Transaction::data, my understanding of the C const rules is that it would then be invalid to write to it. While its unlikely this would ever pose an issue, its not hard to simply make it *mut, so we do that here.
1 parent 90b668e commit 78b4598

File tree

1 file changed

+2
-1
lines changed
  • lightning-c-bindings/src/c_types

1 file changed

+2
-1
lines changed

lightning-c-bindings/src/c_types/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ impl Secp256k1Error {
100100
/// set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
101101
/// `data_is_owned` either set or unset at your discretion.
102102
pub struct Transaction {
103-
pub data: *const u8,
103+
/// This is non-const for your convenience, an object passed to Rust is never written to.
104+
pub data: *mut u8,
104105
pub datalen: usize,
105106
pub data_is_owned: bool,
106107
}

0 commit comments

Comments
 (0)