Skip to content

Commit

Permalink
wallet: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf committed Jun 27, 2019
1 parent 7b41f51 commit 6d1748c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
4 changes: 0 additions & 4 deletions lib/wallet/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ common.isName = function isName(key) {
return key.length >= 1 && key.length <= 40;
};

common.sortTX = function sortTX(txs) {
throw new Error('Deprecated: `common.sortTX()`.');
};

/**
* Sort an array of coins by height.
* @param {Coin[]} txs
Expand Down
4 changes: 1 addition & 3 deletions lib/wallet/nodeclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ class NodeClient extends AsyncEmitter {
if (!entry)
return null;

const time = await this.node.chain.getMedianTime(entry);

return time;
return await this.node.chain.getMedianTime(entry);
}

/**
Expand Down
18 changes: 10 additions & 8 deletions lib/wallet/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1744,26 +1744,28 @@ class RPC extends RPCBase {

async importPrunedFunds(args, help) {
// This could arbitrarily insert transactions from history that
// would cause a shift in transaction counts and could escalate
// into millions of database updates, and should be handled
// when importing address and keys into a wallet instead.
// would cause a shift in transaction counts and would need to
// update the counts of transactions within the related blocks.

// The functionality was added to provide an ability to import
// funds into a pruned node wallet without a rescan. However it
// requires a seperate full node to be able to query full
// transaction history, and many manual tasks to: get the full
// transaction history, and many manual tasks to get the full
// transaction history with merkle proofs.

// This use case can be handled via full automation in a similar
// method that an SPV wallet will rescan history without downloading
// all blocks.
// all blocks, and then single blocks would be downloaded
// and rescanned using filters.
throw new Error('Deprecated: `importprunedfunds`.');
}

async removePrunedFunds(args, help) {
// This could arbitrarily remove transactions from history that
// would cause a shift in transaction counts and could escalate
// into millions of database updates.
// This could leave holes in the transaction counts
// that could affect how rescans would work as there
// could be residual indexes left afterwards. The counts
// would need to be updated after removal. See the comment
// in `importPrunedFunds` for details.
throw new Error('Deprecated: `removeprunedfunds`.');
}

Expand Down
4 changes: 1 addition & 3 deletions lib/wallet/txdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2200,9 +2200,7 @@ class TXDB {
if (!raw)
throw new Error('Transaction count not found.');

const count = TXCount.fromRaw(raw);

return count;
return TXCount.fromRaw(raw);
}

/**
Expand Down

0 comments on commit 6d1748c

Please sign in to comment.