Skip to content

hash: allow Sha256dHashes to be displayed in a truncated format#180

Closed
apoelstra wants to merge 1 commit intorust-bitcoin:masterfrom
apoelstra:2018-10-short-hash-output
Closed

hash: allow Sha256dHashes to be displayed in a truncated format#180
apoelstra wants to merge 1 commit intorust-bitcoin:masterfrom
apoelstra:2018-10-short-hash-output

Conversation

@apoelstra
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member

@clarkmoody clarkmoody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Nice addition for format flexibility.

@dpc
Copy link
Copy Markdown
Contributor

dpc commented Nov 5, 2018

Isn't width supposed to mean the visual width, and not the number of bytes? :) . I think it's a bit of gotcha if it's not the case.

It would make sense to have either:

  • an iterator that yields chars of a hex-ecoding for a given &[u8], or
  • fn hex_encode_write(data: &[u8], out: &mut [u8])

to make this more re-usable.

@clarkmoody
Copy link
Copy Markdown
Member

Isn't width supposed to mean the visual width, and not the number of bytes? :) . I think it's a bit of gotcha if it's not the case.

Oops, that's right: fmt docs

To preserve whole bytes in the output, would it make sense to error on odd-valued width inputs?

@dpc
Copy link
Copy Markdown
Contributor

dpc commented Nov 6, 2018

To preserve whole bytes in the output, would it make sense to error on odd-valued width inputs?

:/ If someone wants first 5 characters of the hash, they should just get it.

@apoelstra
Copy link
Copy Markdown
Member Author

apoelstra commented Nov 6, 2018

Heh, OK, if you guys wanna do it properly then I'll reopen on bitcoin_hashes and also look into what other format modifiers it makes sense to support for hashes.

@apoelstra apoelstra closed this Nov 6, 2018
casey pushed a commit to casey/rust-bitcoin that referenced this pull request Nov 28, 2023
updates to newer jsonrpc dependencies containing swappable transports
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this pull request Mar 23, 2024
…splay

Fix Display/Debug For SortedMultiVec
PastaPastaPasta pushed a commit to PastaPastaPasta/rust-dashcore that referenced this pull request Feb 2, 2026
PastaPastaPasta pushed a commit to PastaPastaPasta/rust-dashcore that referenced this pull request Feb 2, 2026
…itcoin#185)

PR rust-bitcoin#180 used `MultiPeerNetworkManager`, this was renamed in rust-bitcoin#183 which was merged before rust-bitcoin#180 but after its CI run.
PastaPastaPasta pushed a commit to PastaPastaPasta/rust-dashcore that referenced this pull request Feb 2, 2026
…-bitcoin#197)

* feat(spv): flush headers on shutdown

* move fn lower in the impl

* refactor: `MultiPeerNetworkManager` -> `PeerNetworkManager` (rust-bitcoin#184)

* refactor: `MultiPeerNetworkManager` -> `PeerNetworkManager`

* Fix formatting and apply review

* feat: Update ffi headers (rust-bitcoin#183)

* feat(spv): broadcast transaction (rust-bitcoin#180)

* fix: Fix `PeerNetworkManager` cast in `broadcast_transaction` (rust-bitcoin#185)

PR rust-bitcoin#180 used `MultiPeerNetworkManager`, this was renamed in rust-bitcoin#183 which was merged before rust-bitcoin#180 but after its CI run.

* fix: Use non-blocking `TcpStream` in `dash-spv::network::TcpConnection` (rust-bitcoin#188)

* refactor: Improve SPV shutdown handling with `CancellationToken` (rust-bitcoin#187)

* refactor: `TcpConnection` -> `Peer` and `ConnectionPool` -> `PeerPool` (rust-bitcoin#190)

* fix: Locking issue after rust-bitcoin#190 (rust-bitcoin#191)

rust-bitcoin#190 removed the read timeouts of the `Peer::receive_message` which currently leads to a lockup of the peer because the write lock is held while waiting for the message. Needs some more refactoring but this works for now.

* fix: More follow-up to rust-bitcoin#190 (rust-bitcoin#193)

The sleep timeout branch introduced in rust-bitcoin#191 returns an `Err(NetworkError::Timeout)` which leads to a misbehavior update below in the `msg_result` match and eventually in a peer ban. This shouldn't happen because the `sleep` timing out only means that there is no data available right now. Instead, it now returns `Ok(None)` which will just keep things going.

* flush after mn list sync too

* move flush to after header sync instead of mnlist

* fix

---------

Co-authored-by: Kevin Rombach <35775977+xdustinface@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants