Commit graph

385 commits

Author SHA1 Message Date
Roy Lee 67c9c48940 wallet: break recovery() to recovery() and rescanblockchain()
Now the recovery, which runs at startup, only scans for known
addresses that were generated and recorded by this wallet.

The coming rescanblockchain RPC implementation, which requires the
wallet to be unlocked, does account discovery.
2022-10-31 19:53:16 -07:00
Roy Lee 3aca0be46a consolidate: refactor prompt related code 2022-09-29 00:06:51 -07:00
Roy Lee dc7f1e88eb config: remove SigNet and SimNet related code 2022-09-28 23:42:21 -07:00
Roy Lee 79da868c74 wallet: remove public passphrase prompt
1. Remove passphrase support for public keys.
2. Rename privPassphrase to passphrase to avoid confusion.

Note:

There has been a bug in the prompt, which prevents users from
specifying a custom public passphrase. So, most wallet databases
have been using the default password for the public keys, anyway.
2022-09-28 22:12:38 -07:00
Roy Lee 50950fb0d5 multi-account: update listaddresstransactions 2022-09-28 11:48:23 -07:00
Roy Lee 51e700e7d9 multi-account: update listsinceblock 2022-09-28 11:48:23 -07:00
Roy Lee 1edb90e0aa multi-account: update listalltransactions 2022-09-28 11:48:23 -07:00
Roy Lee 2e8dcc4312 multi-account: update listtransactions 2022-09-28 11:48:23 -07:00
Roy Lee 6a610a8cdf multi-account: update getaddressbyaccount 2022-09-28 11:48:23 -07:00
Roy Lee 47e8dbda55 multi-account: set DefaultScope to KeyScopeBIP0044
By design, all scopes shared the same account name/number space.
2022-09-28 11:48:23 -07:00
Roy Lee 169abd446c multi-account: support BIP44 account discovery 2022-09-28 11:48:23 -07:00
Roy Lee 0410b7ce01 consolidate: merge internal/external branches 2022-09-28 11:48:23 -07:00
Roy Lee de408d4133 consolidate: remove watch-only address/account support 2022-09-20 00:29:47 -07:00
Roy Lee e0cb7b7a91 multi-scope: use BIP0049 instead of BIP0049Plus 2022-09-17 14:39:05 -07:00
Roy Lee 1f05a9858b wallet: unblock Lock() when the wallet is shutdown 2022-09-17 13:39:19 -07:00
Roy Lee 79bcb8365c wallet: handle corner cases for reorg 2022-09-13 11:40:06 -07:00
Roy Lee b7013bf5e1 wallet: revert blockhash properly during reorg 2022-09-13 11:40:06 -07:00
Roy Lee aecb972d75 test: update birthday related tests 2022-09-13 10:59:26 -07:00
Roy Lee f4ba8a01d1 Revert "wallet: rescan 2 days past the birthday block"
This reverts commit af82460075.

The 48-hour margin has been set in the waddrmgr.Create() right before
written to the databasw.
2022-09-13 10:59:26 -07:00
Roy Lee af82460075 wallet: rescan 2 days past the birthday block 2022-08-19 17:04:32 -07:00
Roy Lee d9d257a9f6 prompt: minror refactoring 2022-08-19 17:04:32 -07:00
Roy Lee 92acdcbfca rpc: reverse the order of listtransactions to align with lbrycrd (2nd attempt)
The previous change doesn't handle the truncated list.
2022-08-08 17:54:42 -07:00
Roy Lee 46f4df5a64 rpc: reverse the order of listtransactions to align with lbrycrd 2022-08-08 01:26:28 -07:00
Roy Lee 610ec20ea8 ci: run "make fmt" 2022-08-08 01:26:02 -07:00
Roy Lee a7cbb7c481 [lbry] ci: disable few tests for now to unblock CI 2022-07-05 21:06:53 -07:00
Brannon King 1d0ef1da6d [lbry] added staked value to balance call 2022-05-24 10:48:28 -07:00
Brannon King d5328e1834 [lbry] coin selection and balance no longer include stakes 2022-05-24 10:48:28 -07:00
Roy Lee 202374ebd8 [lbry] fork from btcsuite to lbryio
1. btcd -> lbcd
2. btcwallet -> lbcallet
3. btcutil -> lbcutil
2022-05-24 10:31:06 -07:00
Roy Lee 7b5b2ff774 [lbry] remove nested go mudules 2022-05-24 03:09:34 -07:00
Roy Lee 8701ecb329 [lbry] build: remove neutrino and bitcoind support 2022-05-24 03:09:34 -07:00
ennmichael e74c3939aa Fixed a bug where unconfirmed txn notifications were missing a label 2022-05-24 03:09:34 -07:00
Oliver Gugger f2ec9f1ec8 wallet: export ScriptForOutput
We need to be able to call ScriptForOutput in external code, so we
export it.
2022-05-24 03:09:34 -07:00
Oliver Gugger 45a94de617 wallet: return unsigned TX in watch-only SendOutputs
If SendOutputs is called on a watch-only wallet then a transaction is
created but without any signatures. Publishing that transaction will
always fail. But the attempt to publish will already update the internal
state of the wallet so we shouldn't try to publish this unsigned TX.
Instead we return a new error along with the unsigned transaction to
give the caller the chance to sign and publish it through other means.
2022-05-24 03:09:33 -07:00
Bjarne Magnussen 9f1eb98666 wallet: add minimum confirmation parameter to FundPsbt
Setting the minimum confirmation is used for the coin selection when no inputs are provided.
2022-05-24 03:09:33 -07:00
eugene 0fe2b53b69 wallet/txauthor+txrules: update go mod to include btcd changes 2022-05-24 03:09:33 -07:00
Oliver Gugger 8e853a7fb5 wallet: add ImportAccountWithScope
When creating a fully watch-only wallet, we know exactly what accounts
we are importing and what scope should be used for them.
2022-05-24 03:09:33 -07:00
Oliver Gugger 47a13774bb wallet: don't hold unlock in watch-only mode
If we're running in watch-only mode, there is no unlock possible.
Therefore, we also don't need to prevent any unlocks from happening when
doing coin selection in that mode.
2022-05-24 03:09:33 -07:00
Oliver Gugger 4a75796117 wallet+waddrmgr: refactor to use extended key instead of seed
To allow a wallet to be created directly from an extended master root
key (xprv), we move the derivation from seed to extended key to the
loader instead of the address manager itself.
2022-05-24 03:09:33 -07:00
eugene 3cb2c46b02
mod+wallet: use btcd/mempool IsDust for calculating mempool dust
We can now get rid of our incorrect dust calculation which did not
give exact values for segwit outputs as it was based on spending a
P2PKH output instead.
2021-08-03 16:42:20 -04:00
Oliver Gugger f07fdfb6b9
wallet: refactor txToOutputs to use walletdb.Update
To make sure we don't create any manual DB transactions, we refactor the
txToOutputs method to use walletdb.Update and the new
walletdb.ErrDryRunRollBack error for making sure a rollback is issued.
2021-07-23 12:49:38 +02:00
Oliver Gugger 178152bcd0
wallet: refactor ImportAccountDryRun to use walletdb.Update
To make sure we don't create any manual DB transactions, we refactor the
ImportAccountDryRun method to use walletdb.Update and the new
walletdb.ErrDryRunRollBack error for making sure a rollback is issued.
2021-07-23 12:49:37 +02:00
Oliver Gugger 33a0a065f9
wallet: use walletdb.Update in FundPsbt
To make sure we don't create any manual DB transactions, we refactor
FundPsbt to use walletdb.Update instead.
2021-07-23 12:49:37 +02:00
Olaoluwa Osuntokun 5649a66307
Merge pull request #751 from LN-Zap/fix-2398
Prevent duplicate notifications for (un)confirmed transactions
2021-07-13 16:05:48 -07:00
Bjarne Magnussen 419381b749
wallet: call InsertTxCheckIfExists to add a relevant tx
Let the method `addRelevantTx` use `InsertTxCheckIfExists` to insert a relevant 
transaction. If the transaction has already been recorded, the method call 
`addRelevantTx` will return early and not proceed with duplicating work of 
checking every output and duplicating the tx notification to the notification 
server.
2021-07-13 09:24:53 +02:00
Joost Jager 9f1d73d6d3
wallet: allow zero output psbt funding
To support the cpfp fee bump use case where no external outputs are
required.
2021-06-28 12:06:36 +02:00
Joost Jager 4d2665ee3a
wallet: add random coin selection 2021-05-19 08:34:55 +02:00
Wilmer Paulino 5053325946
wallet: add dry run implementation of ImportAccount
This method returns the first N external and internal addresses, which
can be presented to users to confirm whether the account has been
imported correctly.
2021-05-06 16:32:58 -07:00
Olaoluwa Osuntokun a7a9234968
Merge pull request #734 from bhandras/external_db
wallet: allow using external wallet db
2021-04-29 15:48:04 -07:00
Andras Banki-Horvath 98ba16748e
loader: add txn callback when wallet is created 2021-04-28 17:44:11 +02:00
Andras Banki-Horvath a795db6b12
wallet: support for external wallet DB 2021-04-28 17:44:10 +02:00