Skip to content

Commit

Permalink
gui: don't treat new wallets using bitcoind as syncing
Browse files Browse the repository at this point in the history
If the user has imported a descriptor and is using bitcoind as
a local node, then they will need to perform a rescan in order
to see past transactions.

Treating the wallet as syncing in this case could mislead the
user that a rescan is being performed. Therefore, it's better
to keep the past behaviour here to avoid further confusion.
  • Loading branch information
jp1ac4 committed Oct 18, 2024
1 parent 20507ce commit adf15c4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions gui/src/app/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,20 @@ fn wallet_is_syncing(
last_poll: Option<u64>,
blockheight: i32,
) -> bool {
if let Some(_node_type) = node_type {
// Once the first poll has completed, the wallet will be synced
// with the blockchain of the local node.
last_poll <= last_poll_at_startup
if let Some(node_type) = node_type {
if node_type == NodeType::Bitcoind && blockheight <= 0 {
// If blockheight <= 0, then this is a newly created wallet.
// If user imported descriptor and is using a local bitcoind,
// a rescan will need to be performed in order to see
// past transactions and so the syncing status could be
// misleading as it could suggest the rescan is being
// performed.
false
} else {
// Once the first poll has completed, the wallet will be synced
// with the blockchain of the local node.
last_poll <= last_poll_at_startup
}
} else {
// If no node type, treat as remote backend:
// The wallet is always synced except before the first scan
Expand Down

0 comments on commit adf15c4

Please sign in to comment.