Skip to content
Permalink
Branch: master
Commits on Sep 11, 2019
  1. Merge pull request #48 from gcash/recovery

    cpacia committed Sep 11, 2019
    Recovery interrupt
Commits on Sep 7, 2019
  1. Add synced height to network response

    cpacia committed Sep 7, 2019
  2. Update recovery notification sending

    cpacia committed Sep 7, 2019
  3. Add recovery notifications

    cpacia committed Sep 7, 2019
  4. Fix locking during recovery

    cpacia committed Sep 7, 2019
Commits on Sep 3, 2019
  1. Merge pull request #47 from gcash/backport

    cpacia committed Sep 3, 2019
    Backports from btcwallet
  2. Update neutrino dep

    cpacia committed Sep 3, 2019
Commits on Aug 21, 2019
  1. Update neutrino dep

    cpacia committed Aug 21, 2019
  2. Update to lastest bchd rpc interface

    cpacia committed Aug 21, 2019
  3. wallet: fix nil txid in publishTransaction

    wpaulino authored and cpacia committed Jul 10, 2019
    A nil txid could've been returned from publishTransaction even if it was
    successful. This was due to the underlying SendRawTransaction call
    "failing", e.g., when the transaction being broadcast has already
    confirmed, but publishTranasction interpreting such failure as a
    success.
  4. wtxmgr: prevent adding existing confirmed transactions as unconfirmed

    wpaulino authored and cpacia committed Jul 10, 2019
    We do this as a sanity check for users of the wallet to ensure the
    wallet maintains a correct representation of the chain.
  5. chain: remove extraneous rpcclient.Disconnect calls from BitcoindConn

    wpaulino authored and cpacia committed Jul 9, 2019
    These are not needed since they have no effect when the RPC client is
    making HTTP POST requests.
  6. chain: explicitly close connections in BitcoindConn's Stop method

    wpaulino authored and cpacia committed Jul 9, 2019
    Since it's now possible for gozmq.Conn to block when calling Receive,
    BitcoindConn hangs upon being stopped because its goroutines are waiting
    for a message to be delivered. To address this, we modify it to close
    its ZMQ connections driving the goroutines once it's been stopped. This
    allows the goroutines to unblock by detecting the EOF error and exiting.
  7. cmd/dropwtxmgr+waddrmgr: handle constraint when resetting synced state

    wpaulino authored and cpacia committed Jul 5, 2019
    We update the dropwtxmgr utility tool to take into account that the
    wallet only stores MaxReorgDepth blocks, which introduced an additional
    constraint when updating the wallet's synced state. The constraint
    ensures that the previous block exists when updating the wallet's synced
    state, but this does not hold for the birthday block since it's the
    first block we'll store.
  8. wallet: remove wallet best height check when checkpointing intial sync

    wpaulino authored and cpacia committed Jun 20, 2019
    This check is not required since the wallet's best height is the genesis
    block.
  9. wallet: start recovery from the wallet's best height

    wpaulino authored and cpacia committed Jun 20, 2019
    Previously, the wallet would attempt to store the same block it
    checkpointed during its initial sync when performing a recovery. This
    would cause the previous block existence validation check to be in
    place, which would ultimately fail because the previous block was not
    stored intentionally.
    
    To address this, we always start/resume our recovery from the wallet's
    best height. This also ensures that we do not rescan the same block
    again when resuming a recovery after a shutdown.
  10. chain: only allow bitcoind block notifications at tip after NotifyBlocks

    wpaulino authored and cpacia committed May 30, 2019
    One could argue that the behavior before this commit was incorrect, as
    the ChainClient interface expects a call to NotifyBlocks before
    notifying blocks at tip, so we decide to fix this.
    
    Since we now wait for the chain backend to be considered "current"
    before proceeding to sync the wallet with it, any blocks that were
    processed while waiting would result in being notified and scanned
    twice, once by processing it at tip, and another while rescanning the
    wallet, which is not desirable.
  11. wallet: improve error logging for unsuccessful notification handling

    wpaulino authored and cpacia committed May 20, 2019
    If a block arrives while the wallet is rescanning, users would be shown
    a log message that is confusing and not very helpful.
  12. wallet: use locateBirthdayBlock within birthdaySanityCheck

    wpaulino authored and cpacia committed May 20, 2019
    We use the recently introduced locateBirthdayBlock function within
    birthdaySanityCheck as it serves as a more optimized alternative that
    achieves the same purpose.
  13. wallet: remove unused function scanChain

    wpaulino authored and cpacia committed May 20, 2019
  14. wallet: store reorg safe height upon initial sync

    wpaulino authored and cpacia committed May 20, 2019
    Currently, wallet rescans start from its known tip of the chain. Since
    we no longer store blocks all the way from genesis to the tip of the
    chain, performing a rescan would cause us to scan blocks all the way
    from genesis, which we want to avoid. To prevent this, we set the
    wallet's tip to be the current reorg safe height. This ensures that
    we're unable to scan any blocks before it, and that we maintain
    MaxReorgDepth blocks stored.
  15. wallet: modify recovery logic to not start from genesis

    wpaulino authored and cpacia committed May 20, 2019
    This commit serves as another building point to allow the wallet to not
    store blocks all the way from genesis to the tip of chain. We modify the
    wallet's recovery logic to now start from either its birthday block, or
    the current reorg safe height if it's before the birthday, to ensure the
    wallet properly only stores MaxReorgDepth blocks.
    
    We also refactor things a bit in hopes of making the logic a bit more
    readable.
  16. wallet: locate birthday block without scanning chain from genesis

    wpaulino authored and cpacia committed May 20, 2019
    We do this as the wallet will no longer store blocks all the way from
    genesis to the tip of the chain. Instead, in order to find a reasonable
    birthday block, we resort to performing a binary search for a block
    timestamp that's within +/-2 hours of the birthday timestamp.
  17. wallet: wait until chain backend is current to begin wallet sync

    wpaulino authored and cpacia committed May 14, 2019
    This serves as groundwork for only storing up to MaxReorgDepth blocks
    upon initial sync. To do so, we want to make sure the chain backend
    considers itself current so that we can only fetch the latest
    MaxReorgDepth blocks from it.
  18. chain: add IsCurrent method to chain.Interface

    wpaulino authored and cpacia committed May 14, 2019
    IsCurrent allows us to determine if the chain backend considers itself
    "current" with the chain.
  19. wallet: make wallet initial sync synchronous

    wpaulino authored and cpacia committed May 14, 2019
    This ensures the wallet can properly do an initial sync, a recovery, or
    detect if it's on a stale branch before attempting to process new blocks
    at tip.
    
    Since the rescan will be triggered synchronously as well, we'll need to
    catch the wallet's quit chan when handling rescan batches in order to
    allow for clean shutdowns.
  20. waddrmgr: add migration to maintain MaxReorgDepth block hashes stored

    wpaulino authored and cpacia committed May 14, 2019
    In this commit, we add a migration that will be used by existing wallets
    to ensure they can adhere to the new requirement of storing up to
    MaxReorgDepth entries within the block hash index.
Commits on Aug 20, 2019
  1. waddrmgr: maintain a maximum of MaxReorgDepth block hashes stored

    wpaulino authored and cpacia committed May 14, 2019
    In this commit, we modify the wallet's block hash index to only store up
    to MaxReorgDepth blocks. This allows us to reduce consumed storage, as
    we'd be mostly storing duplicate data. We choose to store up to
    MaxReorgDepth to ensure we can recover from a potential long reorg.
  2. Update go mod dependencies

    cpacia committed Aug 20, 2019
  3. waddrmgr: maintain a maximum of MaxReorgDepth block hashes stored

    wpaulino authored and cpacia committed May 14, 2019
    In this commit, we modify the wallet's block hash index to only store up
    to MaxReorgDepth blocks. This allows us to reduce consumed storage, as
    we'd be mostly storing duplicate data. We choose to store up to
    MaxReorgDepth to ensure we can recover from a potential long reorg.
  4. wallet: check RPC error code for rejected confirmed transactions

    wpaulino authored and cpacia committed May 11, 2019
    This unifies the logic of receiving an error when broadcasting a
    confirmed transaction through btcd's/bitcoind's RPC interface. The btcd
    dependency update is required in order for it to match bitcoind's
    behavior. For older nodes that have yet to update, the confirmed
    transaction will still be caught by the "transaction already exists"
    case. This is not needed for bitcoind however, because its been sending
    the same RPC error code for several major releases now.
  5. chain: avoid using defer for BitcoindClient onRescanFinished notifica…

    wpaulino authored and cpacia committed May 11, 2019
    …tion
    
    Since defer will copy the function with the parameters evaluated at its
    invocation, the RescanFinished notification would be dispatched with the
    incorrect block. To fix this, we'll just send the notification at the
    end ourselves manually.
Older
You can’t perform that action at this time.