diff --git a/pkg/tbtc/chain.go b/pkg/tbtc/chain.go index 9eaa645b86..d8bfec302e 100644 --- a/pkg/tbtc/chain.go +++ b/pkg/tbtc/chain.go @@ -245,6 +245,8 @@ type WalletClosedEvent struct { // BridgeChain defines the subset of the TBTC chain interface that pertains // specifically to the tBTC Bridge operations. type BridgeChain interface { + // IsWalletRegistered checks whether the given wallet is registered in the + // ECDSA wallet registry. IsWalletRegistered(EcdsaWalletID [32]byte) (bool, error) // GetWallet gets the on-chain data for the given wallet. Returns an error diff --git a/pkg/tbtc/node.go b/pkg/tbtc/node.go index a29facff2c..a4346397e5 100644 --- a/pkg/tbtc/node.go +++ b/pkg/tbtc/node.go @@ -1089,6 +1089,7 @@ func processCoordinationResult(node *node, result *coordinationResult) { } } +// archiveClosedWallets archives closed or terminated wallets. func (n *node) archiveClosedWallets() error { getClosedWallets := func(walletPublicKeyHashes [][20]byte) ( closedWallets [][20]byte, diff --git a/pkg/tbtc/registry.go b/pkg/tbtc/registry.go index 6f469862de..4c81938de9 100644 --- a/pkg/tbtc/registry.go +++ b/pkg/tbtc/registry.go @@ -156,6 +156,9 @@ func (wr *walletRegistry) getWalletByPublicKeyHash( return wallet{}, false } +// archiveWallet archives the wallet with the given public key hash. The wallet +// data is removed from the wallet cache and the entire wallet storage directory +// is moved to the archive directory. func (wr *walletRegistry) archiveWallet( walletPublicKeyHash [20]byte, ) error { @@ -233,6 +236,8 @@ func (ws *walletStorage) saveSigner(signer *signer) error { return nil } +// archiveWallet archives the given wallet data in the underlying persistence +// layer of the walletStorage. func (ws *walletStorage) archiveWallet(walletStoragePath string) error { err := ws.persistence.Archive(walletStoragePath) if err != nil {