Commit Graph

1034 Commits

Author SHA1 Message Date
Ivan Socolsky 755449e32d return utxo list 2016-03-11 13:42:26 -03:00
Ivan Socolsky 0aa0f345a3 add max size check 2016-03-11 13:42:25 -03:00
Ivan Socolsky 42ae722db9 tests 2016-03-11 13:42:25 -03:00
Ivan Socolsky 8d25f23849 get send max info 2016-03-11 13:38:42 -03:00
Matias Alejo Garcia a3da2deb65 Merge pull request #477 from isocolsky/utxo-selection
Improve UTXO selection
2016-03-11 11:56:42 -03:00
Ivan Socolsky a4ced0320f refactor fee correction on change below dust 2016-03-11 11:47:57 -03:00
Ivan Socolsky 10b4ff3d15 fix netTotal bug + test 2016-03-11 11:13:29 -03:00
Ivan Socolsky 8ce304fd4e reduce safety margin to 2% 2016-03-10 18:59:04 -03:00
Ivan Socolsky 8865d42ec3 improve fee computation for P2PKH wallets 2016-03-10 18:58:56 -03:00
Ivan Socolsky ee7d3bad7f allow absolute fee when specifying inputs 2016-03-10 11:47:54 -03:00
Ivan Socolsky f976637b14 improve code readability 2016-03-09 10:45:37 -03:00
Ivan Socolsky 5afc74d4f6 revert breaking conditions for small inputs to improve tracing 2016-03-09 10:18:13 -03:00
Ivan Socolsky c3ee9e9b93 shuffle inputs 2016-03-08 15:47:31 -03:00
Ivan Socolsky 49791bcfdf remove redundant check for very small utxos 2016-03-08 15:28:49 -03:00
Ivan Socolsky c01d1568bb adapt fee to avoid change below dust 2016-03-08 15:28:28 -03:00
Ivan Socolsky 9ed48f1e77 keep adding utxos to raise change above dust 2016-03-08 10:55:32 -03:00
Gabriel Bazán c43a11d647 refactor ios payload structure 2016-03-08 09:49:00 -03:00
Ivan Socolsky 293c15a3d3 Merge pull request #4 from matiu/utxo-tests
Utxo tests
2016-03-08 09:37:16 -03:00
Ivan Socolsky 72cf236bd6 fix variable names 2016-03-08 09:29:57 -03:00
Ivan Socolsky 37d27cec40 create compound index for walletId, createdOn. drop old index 2016-03-08 08:59:01 -03:00
Ivan Socolsky 08cb603a50 merge utxo exclusion into sanitize fn 2016-03-07 15:44:40 -03:00
Ivan Socolsky cbde3233df handle lots of small inputs causing the total balance after fees to decrease 2016-03-07 15:26:04 -03:00
Ivan Socolsky 680516da70 replace old utxo selection algo 2016-03-07 13:04:18 -03:00
Ivan Socolsky 504b52d695 compare both utxo selection algorithms 2016-03-07 13:00:53 -03:00
Ivan Socolsky d3faad0639 make select fn async 2016-03-07 12:30:10 -03:00
Ivan Socolsky c8d8af7d1d create compound index for walletId, createdOn. drop old index 2016-03-07 09:59:15 -03:00
Ivan Socolsky 60f6300fbc rebased 2016-03-04 17:53:16 -03:00
Ivan Socolsky 2581f488fa improve error handling 2016-03-04 17:50:23 -03:00
Ivan Socolsky 485b98de86 fix big input threshold computation 2016-03-04 17:50:23 -03:00
Ivan Socolsky c90d5bfed4 proper log messages 2016-03-04 17:50:23 -03:00
Ivan Socolsky 62c0fb06ef test utxo confirmation priority 2016-03-04 17:50:23 -03:00
Ivan Socolsky a8cd4fe2c6 improve test cases 2016-03-04 17:50:23 -03:00
Ivan Socolsky fdd5255e59 add stop conditions for small utxos 2016-03-04 17:50:23 -03:00
Ivan Socolsky cd82017845 fix tests 2016-03-04 17:50:23 -03:00
Ivan Socolsky 328f6250be improve utxo mocking 2016-03-04 17:50:23 -03:00
Ivan Socolsky dbba3acfa8 new input selection algorithm 2016-03-04 17:50:22 -03:00
Ivan Socolsky 5f5aed6345 cache last fee level 2016-03-04 17:02:05 -03:00
Ivan Socolsky f878594d40 rm feeLevel 2016-03-04 11:07:17 -03:00
Ivan Socolsky 682bf7fdd2 make feePerKb required 2016-03-04 11:06:16 -03:00
Ivan Socolsky 446f35426f remove explicit final fee for tx creation 2016-03-04 10:30:26 -03:00
Ivan Socolsky 37f87e4793 accept feeLevel on createTx 2016-03-04 10:30:26 -03:00
Ivan Socolsky 9e0891f644 new defaults 2016-03-04 09:51:59 -03:00
Ivan Socolsky f7013a4589 expand address scan gap 2016-03-01 10:56:13 -03:00
Matias Alejo Garcia 791330e82f better logs 2016-02-23 16:00:34 -03:00
Matias Alejo Garcia 52570d3d40 change log level 2016-02-23 13:54:26 -03:00
Matias Alejo Garcia 3c02a0bf89 Merge pull request #466 from isocolsky/fix/lotsa-utxos
Improve UTXO selection & add tx max size limit
2016-02-19 13:51:17 -03:00
Ivan Socolsky 2e19d6164b improve utxo selection & add tx max size limit 2016-02-19 12:30:40 -03:00
Javier e9275bf232 stacking notifications in android 2016-02-19 11:19:32 -03:00
Javier 831d93ab3b hashing wallet id from notification 2016-02-19 11:16:31 -03:00
Javier 0a40c0d128 add additional data to be used when notification is clicked 2016-02-19 11:16:31 -03:00
Ivan Socolsky 3406f57bbc rename method
Conflicts:
	lib/blockchainexplorers/insight.js
2016-02-18 12:02:18 -03:00
Ivan Socolsky f89c249e12 deterministic balance byAddress 2016-02-18 12:00:36 -03:00
Matias Alejo Garcia 270c5cbeff mv constant to defaults 2016-02-17 16:45:56 -03:00
Matias Alejo Garcia 4dfda532c8 update history limit 2016-02-17 16:19:49 -03:00
Matias Alejo Garcia 7eea242300 update name to requestList 2016-02-17 00:15:43 -03:00
Matias Alejo Garcia 396bed8873 add multiple insight server support 2016-02-16 17:09:53 -03:00
Matias Alejo Garcia f04b2e821b rm debug log level 2016-02-11 11:10:40 -05:00
Ivan Socolsky 3f5f219450 fix returning old rates 2016-02-10 18:21:48 -03:00
Ivan Socolsky 9404dee2d8 Merge pull request #450 from tanojaja/fix/push-notifications-logs
fix push notifications service logs
2016-02-02 11:45:03 -03:00
Braydon Fuller 7530ee9d0e Wallet Model: Check that "m" and "n" arguments are numbers 2016-02-01 11:21:49 -05:00
Ivan Socolsky f7328fc4ce check fee xor feePerKb 2016-02-01 09:58:26 -03:00
Ivan Socolsky 4bad281966 delay NewTxProposal notification until published 2016-01-29 11:22:20 -03:00
Ivan Socolsky 23cddbe47f fix broadcasting new proposals 2016-01-29 10:51:06 -03:00
Javier e622e28c76 refactor logs 2016-01-29 10:02:44 -03:00
Ivan Socolsky 77dc536a15 check fee limits 2016-01-28 18:20:48 -03:00
Ivan Socolsky 6f196aa1b9 allow fee to be specified on proposal creation 2016-01-28 17:53:22 -03:00
Ivan Socolsky 5f35aafc29 fix proposal signature validation in publishTx 2016-01-28 11:01:03 -03:00
Javier b4d94da709 fix push notifications service logs 2016-01-27 10:45:26 -03:00
Matias Alejo Garcia 383c2d63c8 . 2016-01-20 23:17:56 -03:00
Matias Alejo Garcia 427c56d4d6 add sound to ios 2016-01-20 23:15:35 -03:00
Javier 926bd81eda add log level debug 2016-01-20 16:38:11 -03:00
Matias Alejo Garcia 73e60d5d0f Merge pull request #442 from gabrielbazan7/feat/pushNotifications
fix user field ( push notifications )
2016-01-18 18:03:19 -03:00
Gabriel Bazán 965a859cbc delete token variable 2016-01-18 17:37:40 -03:00
Gabriel Bazán 9d4afc4402 fix user field 2016-01-18 16:28:11 -03:00
Ivan Socolsky b8f51ce756 fix error condition 2016-01-18 13:22:30 -03:00
Gabriel Bazán bcd840c7fc check token in opts 2016-01-18 10:26:37 -03:00
Gabriel Bazán bd7bcbab45 push notifications unsubscribe method refactor 2016-01-18 09:40:35 -03:00
Gabriel Bazán c71f6c637f push notifications service subscribe, unsubscribe and tests 2016-01-18 09:40:35 -03:00
Ivan Socolsky 5c75fde169 check new client version for paypro txs 2016-01-15 20:00:33 -03:00
Ivan Socolsky 8a6c5dfc13 establish a limit on look back time for a valid rate 2016-01-13 16:29:04 -03:00
Ivan Socolsky 57912a3180 define constants in defaults.js 2016-01-13 16:05:08 -03:00
Ivan Socolsky b9b1bddea8 REST endpoint + added to shell command 2016-01-13 16:05:08 -03:00
Ivan Socolsky 10ac3a4d65 init fiat rate service from within bws 2016-01-13 16:04:40 -03:00
Ivan Socolsky aac0b70df4 separate initialization from cron job 2016-01-13 16:03:06 -03:00
Ivan Socolsky 8d6d545139 test error handling in fetching process 2016-01-13 16:03:05 -03:00
Ivan Socolsky aa415268fc test fetch 2016-01-13 16:03:05 -03:00
Ivan Socolsky 5d868d57c4 test specific provider 2016-01-13 16:03:05 -03:00
Ivan Socolsky e62e5b032d add fetchedOn to returned rates 2016-01-13 16:03:05 -03:00
Ivan Socolsky 0922a5fa6e integration tests 2016-01-13 16:03:05 -03:00
Ivan Socolsky 450da4ecdc add fiat rate service 2016-01-13 16:03:05 -03:00
Ivan Socolsky 86c36eba84 Merge pull request #429 from gabrielbazan7/feat/pushNotifications
push notifications
2016-01-13 15:44:02 -03:00
Ivan Socolsky ec9a6cde9b Merge pull request #434 from troggy/history-custom-data
Return tx customData wth txHistory
2016-01-13 15:40:34 -03:00
Gabriel Bazán 5c1a95d5d2 refactor 2016-01-13 13:14:42 -03:00
Kosta Korenkov 6a9db29192 Return tx customData wth txHistory 2016-01-13 19:11:47 +03:00
Ivan Socolsky 4da8a37dc4 fix issue with retrieving active addresses 2016-01-13 11:22:29 -03:00
Ivan Socolsky f2c29d8dee send BalanceUpdated notification as global 2016-01-13 11:20:22 -03:00
Gabriel Bazán ba1c603977 add integrations test - should exclude outgoing notifications 2016-01-12 17:26:44 -03:00
Javier a3ed3a5128 config and pushNotifications service modified 2016-01-12 09:44:30 -03:00
Gabriel Bazán 153144ace4 fix copayer creator id error 2016-01-08 17:11:28 -03:00
Gabriel Bazán a2f00de699 clean code 2016-01-08 17:01:35 -03:00
Gabriel Bazán aacf21778d refactor 2016-01-08 13:26:51 -03:00
Gabriel Bazán c473182a74 adding ios options 2016-01-08 09:58:46 -03:00
Gabriel Bazán bd503b302c apply templates and languages 2016-01-06 17:34:51 -03:00
Gabriel Bazán 2d923e34f5 notifications for android - without include creator 2016-01-05 18:26:51 -03:00
Gabriel Bazán bd109a37d5 refactor 2016-01-05 10:53:05 -03:00
Gabriel Bazán 71f06170bf bits in notifications 2016-01-04 16:38:47 -03:00
Gabriel Bazán b7f98bb752 refactor 2016-01-04 15:56:14 -03:00
Gabriel Bazán b193685b41 refactor 2016-01-04 14:47:57 -03:00
Gabriel Bazán bfc49c94f8 push notifications 2016-01-04 14:43:21 -03:00
Ivan Socolsky c2d0d59955 fix border condition 2015-12-22 17:13:50 -03:00
Ivan Socolsky a002ff0cfc return both totalSize & confirmedSize 2015-12-22 16:53:25 -03:00
Ivan Socolsky 88f972e7d3 use getTotalAmount() instead of amount field 2015-12-18 12:41:45 -03:00
Ivan Socolsky 3bef4f30b6 initialize amount field on multiple_output tx proposals 2015-12-16 00:21:58 -03:00
Matias Alejo Garcia 60e69a3856 Merge pull request #418 from isocolsky/feat/cache
Optimize balance computation
2015-12-15 12:51:54 -03:00
Ivan Socolsky 30e3e72263 add log message 2015-12-14 17:33:04 -03:00
Ivan Socolsky 124742a792 update active addresses from bc monitor 2015-12-14 17:30:28 -03:00
Ivan Socolsky 4198d5c47c handle initial conditions (empty cache) 2015-12-14 17:04:37 -03:00
Matias Alejo Garcia 0968de59dd enforce txhistory limit 2015-12-14 16:41:06 -03:00
Matias Alejo Garcia 4eb3caea00 force history limit 2015-12-14 16:28:39 -03:00
Ivan Socolsky 87b96d4a8f keep getStatus() method, add twoStep param 2015-12-11 16:32:38 -03:00
Ivan Socolsky 82f54f7901 remove comment 2015-12-11 16:13:08 -03:00
Ivan Socolsky 072aed5cc1 cache address strings only 2015-12-10 14:40:43 -03:00
Ivan Socolsky 56d1562e92 express endpoint 2015-12-10 13:03:18 -03:00
Ivan Socolsky 4e7241e86d add v2/balance endpoint 2015-12-10 13:03:18 -03:00
Ivan Socolsky 9868cd7c34 fix tests 2015-12-10 13:03:17 -03:00
Ivan Socolsky 0ab57133fd fix tests 2015-12-10 13:03:17 -03:00
Ivan Socolsky 94a376ca33 store cached data in db 2015-12-10 13:03:17 -03:00
Ivan Socolsky 3874d14f71 2 step getBalance 2015-12-10 13:03:17 -03:00
Ivan Socolsky 8c0882bf82 accept address list when fetching utxos for current wallet 2015-12-10 13:03:17 -03:00
Ivan Socolsky a838978b3f return null when totalBytesToSendMax cannot be evaluated (instead of 0) 2015-12-10 13:03:17 -03:00
Ivan Socolsky cb677303b6 fix log message 2015-12-10 13:03:17 -03:00
Ivan Socolsky 784a5ad1dc enforce max gap limit on v3 2015-12-09 11:02:50 -03:00
Matias Alejo Garcia a1596e4dd6 Merge pull request #407 from isocolsky/ref/proposal-flow
WIP: Ref/proposal flow
2015-12-09 10:25:11 -03:00
Matias Alejo Garcia b475dae5d8 Merge pull request #415 from isocolsky/ref/wallet-lock
Reduce wallet lock times
2015-12-08 17:26:18 -03:00
Ivan Socolsky 6f280d07da Revert "Temporarily disable max address gap limit" 2015-12-08 17:10:18 -03:00
Ivan Socolsky b15c0c3ce8 reduce wait time to 5 sec, max execution time to 5 min 2015-12-08 12:26:32 -03:00
Ivan Socolsky 89b2a08f9f rename sendTx -> publishTx 2015-12-08 12:01:49 -03:00
Ivan Socolsky 3f35d8f141 return upgrade_needed for legacy clients 2015-12-08 10:30:27 -03:00
Ivan Socolsky 0bb043d034 simplify proposal creation + allow non-validated outputs (external txps) 2015-12-08 10:30:27 -03:00
Ivan Socolsky 0a5e144f93 add express endpoint for sending tx 2015-12-08 10:30:27 -03:00
Ivan Socolsky 092c3ff37e make self contained signature keys optional 2015-12-08 10:30:27 -03:00
Ivan Socolsky 87d7a1bd92 tests for proposal signature & signing key 2015-12-08 10:30:27 -03:00
Ivan Socolsky 76831caf50 verify proposal signature over raw tx 2015-12-08 10:30:26 -03:00
Ivan Socolsky 4a7614e2d5 rename createTx -> createTxLegacy 2015-12-08 10:30:26 -03:00
Ivan Socolsky 8ef05c8841 check available utxos when sending temporary txp 2015-12-08 10:30:26 -03:00
Ivan Socolsky 30c8072b8b send tx (publish) + tests 2015-12-08 10:30:26 -03:00
Ivan Socolsky 5755b965e8 use TxProposal#fromObj as a factory for proposals 2015-12-08 10:30:26 -03:00
Ivan Socolsky 2211847d0c remove type from txproposal model 2015-12-08 10:30:26 -03:00
Ivan Socolsky 9db456550f create temporary proposal + test 2015-12-08 10:30:26 -03:00
Ivan Socolsky 6deb9e77f6 txproposalv3 -> txproposal 2015-12-08 10:30:26 -03:00
Ivan Socolsky 563ee14dc1 txproposal.js -> txproposal_legacy.js 2015-12-08 10:30:26 -03:00
Ivan Socolsky 63eca6b529 txProposal v3 2015-12-08 10:28:21 -03:00
Ivan Socolsky 92f9f0bc7d force ignoreMaxGap flag 2015-12-06 01:19:13 -03:00
Ivan Socolsky 98773fe40a handle invalid xpub on wallet join 2015-12-01 11:25:59 -03:00
Ivan Socolsky 1b6980fd1e call toObject before storing models 2015-11-23 17:28:02 -03:00
Ivan Socolsky 80d1d31130 Merge pull request #330 from troggy/txp/manual-outputs
Add EXTERNAL proposal type
2015-11-20 15:10:40 -03:00
Ivan Socolsky 524ed773e2 add WALLET_LOCKED error on lock timeout 2015-11-20 11:08:01 -03:00
Matias Alejo Garcia f8248a0eba Merge pull request #403 from isocolsky/fix/multi-output-no-change
Fix/multi output no change
2015-11-18 16:03:51 -03:00
Ivan Socolsky 5794883eb0 allow either script or toAddress 2015-11-16 18:39:51 -03:00
Ivan Socolsky 6476de0461 remove unused elements in output order array 2015-11-16 17:59:48 -03:00
Kosta Korenkov 2bdc6cf19d Make API.createTx accept preselected inputs
Add EXTERNAL tx type

It will allow clients to specify inputs and outputs when creating proposals

Extract _validateOutputs method

Use for-loop to simplify and make it fail-fast.

Do not validate outputs for EXTERNAL tx type

Outputs may be of any kind (e.g. OP_RETURN). It is assumed that outputs are validated by caller.

Move output validation to a single place

Check tx and estimate fees for EXTERNAL proposal

Set amount for external proposals

Use changeAddress to determine network

Do not shuffle outputs for EXTERNAL txp

Fix input selection to respect fees

Add more inputs, if we selected exactly the amount to spend, so we avoid 'Insufficient funds for a fee' error

Properly handle UTXO with 0 satoshis

Minor fixes

ignore invalid utxos
2015-11-11 21:23:44 +03:00
Ivan Socolsky 446d7ff2e5 tx.derivationStragegy = wallet.derivationSTrategy 2015-11-11 12:14:07 -03:00
Ivan Socolsky fa58b5b778 restore derivation strategy on txps 2015-11-11 11:59:34 -03:00
Matias Alejo Garcia a1f58a6c8c Merge pull request #393 from isocolsky/remove-bwu-dep
Remove BWU dependency
2015-11-09 10:48:09 -03:00
Ivan Socolsky 414b4403c4 remove unused method 2015-11-06 12:05:33 -03:00
Ivan Socolsky 714b95b32c remove derivationStrategy field from txp 2015-11-06 12:02:41 -03:00
Ivan Socolsky 2367365707 fix GET v1/addresses/ endpoint 2015-11-04 12:36:39 -03:00
Ivan Socolsky e55983b151 mv Utils.buildTx -> TxProposal 2015-11-03 13:01:12 -03:00
Ivan Socolsky 2bec543c6f mv Utils.deriveAddress -> Address.derive 2015-11-03 12:21:31 -03:00
Ivan Socolsky 795097bf04 refactor constants+defaults+utils -> common 2015-10-30 17:16:20 -03:00
Ivan Socolsky d451fff6fc clean up address scan config 2015-10-30 15:39:33 -03:00
Ivan Socolsky eb006c3db3 remove bitcore-wallet-utils dependency 2015-10-30 15:24:47 -03:00
Ivan Socolsky ea5926229c move constants definitions to own module 2015-10-30 15:24:28 -03:00
Ivan Socolsky 5fba6c7f75 redefine constants 2015-10-30 10:34:13 -03:00
Matias Alejo Garcia 3425f9ec57 Merge pull request #392 from isocolsky/feat/get-main-addresses-params
Add params to getMainAddresses
2015-10-29 16:38:22 -03:00
Matias Alejo Garcia 5edfe3d384 Merge pull request #390 from isocolsky/limit-address-gap
Limit nb of consecutive addresses without activity
2015-10-29 16:37:47 -03:00
Ivan Socolsky 69dda0ed6a remove unused walletId param 2015-10-29 16:35:30 -03:00
Ivan Socolsky 1872f07eed do not perform check on v1 API 2015-10-29 15:28:11 -03:00
Ivan Socolsky 5a3eef6c5c pass params from express endpoint 2015-10-29 15:19:32 -03:00
Ivan Socolsky ef18c786fb handle limit & reverse params 2015-10-29 15:17:39 -03:00
Matias Alejo Garcia ade6458b6c add tests 2015-10-28 18:34:05 -03:00
Matias Alejo Garcia eb4c1fda03 use blocktime if present 2015-10-28 17:46:48 -03:00
Ivan Socolsky 64a48db991 check single address activity on blockchain 2015-10-28 13:25:32 -03:00
Ivan Socolsky 0b43b3b85c cache address activity 2015-10-28 13:23:13 -03:00
Ivan Socolsky 89575da4e8 optimize activity check for single address 2015-10-27 16:51:15 -03:00
Ivan Socolsky cf37d013b6 changed stub methods & more tests 2015-10-27 16:22:42 -03:00
Ivan Socolsky a8a6962c74 check activity of previous addresses before generating a new one 2015-10-27 16:00:29 -03:00
Ivan Socolsky 2f990f42a8 test 2015-10-27 15:38:11 -03:00
Ivan Socolsky f00b5dbe68 refactor constant definition 2015-10-27 15:19:38 -03:00
Ivan Socolsky 5eb9976646 remove comments 2015-10-26 19:34:27 -03:00
Ivan Socolsky fb035c0ffc receive address activity as json 2015-10-26 19:30:57 -03:00
Ivan Socolsky 09d2ad3225 remove delay 2015-10-26 19:30:43 -03:00
Ivan Socolsky 284c2540f9 do not go beyond max gap addresses 2015-10-26 18:31:10 -03:00
Ivan Socolsky 9ffcb7e470 scan addresses 1 by 1 and rewind to last used one 2015-10-26 18:05:53 -03:00
Ivan Socolsky e7855e1e89 replace minTs with timeSpan (in secs) in /v1/notifications 2015-10-19 17:23:50 -03:00
Ivan Socolsky d6f9633a73 improve tests 2015-10-19 15:04:09 -03:00
Ivan Socolsky 09c5af073d accept minTs arg on v1/notifications but limit it to now - 60s 2015-10-19 14:58:38 -03:00
Ivan Socolsky 5c048e390c fetch new block notifications along with regular wallet notifications 2015-10-19 14:28:43 -03:00
Ivan Socolsky 92944d1d40 remove old fetchNotifications method 2015-10-19 14:27:29 -03:00
Ivan Socolsky bee66435e9 store new block notifications with walletId=network 2015-10-19 13:09:33 -03:00