Skip to content

Commit

Permalink
fix: p2sh address from script
Browse files Browse the repository at this point in the history
  • Loading branch information
Crayon Shin-chan committed Aug 21, 2024
1 parent 82a9b01 commit ebb1209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion invoice/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ impl AddressPayload {
AddressPayload::Pkh(PubkeyHash::from(bytes))
} else if script.is_p2sh() {
let mut bytes = [0u8; 20];
bytes.copy_from_slice(&script[2..]);
bytes.copy_from_slice(&script[2..22]);

Check warning on line 324 in invoice/src/address.rs

View check run for this annotation

Codecov / codecov/patch

invoice/src/address.rs#L324

Added line #L324 was not covered by tests
AddressPayload::Sh(ScriptHash::from(bytes))
} else if script.is_p2wpkh() {
let mut bytes = [0u8; 20];
Expand Down

0 comments on commit ebb1209

Please sign in to comment.