Daniel Cousens
9620b68fe2
Wallet: use __processTx over a free function
...
The use of bind in this case wasn't idiomatic.
2014-08-16 17:26:27 +10:00
Daniel Cousens
300facf7aa
Wallet: use === when comparing with undefined
2014-08-16 17:26:27 +10:00
Daniel Cousens
4bb7f5b56d
Wallet: use indexOf explicitly over include*
2014-08-16 17:26:27 +10:00
Wei Lu
e55676cf8e
Wallet: remove unncessary comments
2014-08-16 14:27:12 +08:00
Wei Lu
00d58604a4
Wallet: move getPrivateKeyForAddress to prototype
...
also, move the assert to the end to simplify the logic
2014-08-16 14:24:24 +08:00
Wei Lu
2b4d94cd92
Wallet: move processPendingTx & processConfirmedTx to prototype
...
also, move processTx out of Wallet scope
2014-08-16 14:19:19 +08:00
Daniel Cousens
c13177bb29
Wallet: rename masterkey to masterKey
2014-08-14 17:29:14 +10:00
Daniel Cousens
6df785bb65
Wallet: move createTx to prototype
2014-08-14 11:17:12 +10:00
Daniel Cousens
7fd41fae4a
Wallet: move most instance methods to prototype
2014-08-14 11:17:12 +10:00
Daniel Cousens
2f00c9ab35
Wallet: rework unspents to primarily work on initialization
...
The RegExp for the UTXO validation was removed as the errors are now
more verbose and specific to each case.
2014-08-14 11:17:10 +10:00
Daniel Cousens
7c22067f69
Wallet: clarify getPrivateKeyForAddress method structure
...
This does repeat the O(n) lookup several times, but that can be fixed by
using an O(1) lookup instead (and will be later).
Clarity first.
2014-08-14 11:00:29 +10:00
Daniel Cousens
abc3e6c715
Wallet: move estimatePaddedTxFee out of Wallet scope
2014-08-14 11:00:29 +10:00
Daniel Cousens
8b3470e8ca
Wallet: move all free functions out of Wallet scope
2014-08-14 11:00:29 +10:00
Daniel Cousens
d618aa9822
Wallet: deprecates newMasterKey
2014-08-14 11:00:18 +10:00
Daniel Cousens
8e0c835919
package: use crypto-browserify 3.0.0
2014-07-28 13:51:30 +10:00
Wei Lu
f7af487597
wallet: reintroduce output.to to track pending spent utxo
2014-06-28 18:29:47 -07:00
Wei Lu
82b1d8fbdc
wallet: do not delete pending incoming tx from outputs
2014-06-21 19:21:26 +08:00
Wei Lu
79a17d67ec
wallet: do not overestimate fees when network has dustSoftThreshold
2014-06-18 21:16:17 +08:00
Wei Lu
7e31668b69
wallet: rename utxo.receive to utxo.from
2014-06-18 14:34:53 +08:00
Wei Lu
7e98123ccd
wallet.getUnspentOutputs includes the pending field
2014-06-18 14:29:02 +08:00
Wei Lu
bc3e0770f9
Add fee estimation functions for dogecoin and litecoin
2014-06-17 22:46:18 +08:00
Wei Lu
122b613eaf
Move fee estimation into networks.js
2014-06-17 22:43:32 +08:00
Wei Lu
45a72416c9
wallet: Move dust and fee per kb into networks.js
2014-06-17 22:38:03 +08:00
Daniel Cousens
c0e5393595
Transaction: remove .outpoint object
2014-06-16 14:21:40 +10:00
Daniel Cousens
2a267b62e6
jshint: remove unused variables
2014-06-16 14:21:40 +10:00
Daniel Cousens
d567463588
Transaction: remove estimateFee
...
This is a wallet abstraction.
2014-06-16 14:21:39 +10:00
Daniel Cousens
5551c38812
Transaction: use hash Buffer instead of hex string
2014-06-16 14:21:39 +10:00
Daniel Cousens
2f56e63491
Wallet: avoid transaction inspection when signing
2014-06-16 14:21:39 +10:00
Daniel Cousens
bdc7131d0e
Transaction: renames getHash to getId
...
In turn also removes the inherent calculation of tx.hash after deserialization.
2014-06-16 14:21:39 +10:00
Daniel Cousens
a6b9dd9473
Transaction: remove hash:index notation
2014-06-16 14:21:38 +10:00
Daniel Cousens
8b5647b0b9
Transaction: remove TxIn/TxOut exports
2014-06-16 14:21:38 +10:00
Daniel Cousens
55ff383c7b
Wallet: remove superfluous false parameter
...
This parameter is unnecessary.
The use of `false` causes the default parameter to be used instead; even though the absence of such would also cause said behaviour to occur.
2014-06-15 00:38:21 +10:00
Wei Lu
8e00eb6855
Merge branch 'scriptclean'
...
Conflicts:
test/wallet.js
2014-06-14 10:31:19 +08:00
Daniel Cousens
7e5af52cd1
Transaction: mass rename from SPK/SS to Input/Output
...
I think it is important we maintain some reasoning that an Input script
is actually a script signature, but in the end, these names are more
coherent and understandable when reasoning with our code. So I think
its OK we break tradition with bitcoind.
2014-06-13 11:36:31 +10:00
Wei Lu
f53e35ed28
wallet: delete utxo instead of marking it as spend
2014-06-12 16:48:01 +08:00
Wei Lu
d265b53b03
wallet: processTx -> processConfirmedTx, processPendingTx
2014-06-12 16:47:46 +08:00
Wei Lu
e064e9d29d
wallet.createTx ignores pending utxo
2014-06-12 13:11:28 +08:00
Wei Lu
660c95483d
wallet.processTx accepts isPending flag and passes it on to output
2014-06-12 12:56:50 +08:00
Daniel Cousens
f5005299d1
JSHint: remove defined but never used
2014-06-04 15:46:24 +10:00
Daniel Cousens
6a73bc02f5
HDNode: rename priv/pub to privKey/pubKey
2014-06-03 19:54:58 +10:00
Daniel Cousens
64e307b13f
HDWallet: rename to HDNode
2014-06-03 17:08:42 +10:00
Daniel Cousens
dca284a131
HDWallet: rename derivePrivate to deriveHardened
2014-06-03 17:04:05 +10:00
Daniel Cousens
c0006c299f
HDWallet: use new constructor
2014-05-31 20:40:57 +10:00
Daniel Cousens
3bce535e36
Wallet: use assert for consistency
2014-05-31 14:28:16 +10:00
Daniel Cousens
cde285ccfc
Wallet: enforce operator new
2014-05-30 19:01:03 +10:00
Daniel Cousens
4952c5f4e7
HD/Wallet: use network objects, not strings
2014-05-30 19:01:02 +10:00
Daniel Cousens
2df790e2ab
Wallet: remove use of hashLittleEndian
2014-05-30 18:17:32 +10:00
Daniel Cousens
4afdbc9f68
Wallet: use dustThreshold directly
...
The definition of a dust amount is pretty clear, and I feel it is less
readable when represented as isDust(amount) or !isDust(amount), by
comparison to amount <= dustThreshold or amount > dustThreshold.
Also means I don't have to stray my eyes to understand the
implemention by looking up isDust does.
2014-05-30 18:17:32 +10:00
Daniel Cousens
bd3690bdc0
Wallet: remove async interface
2014-05-30 18:17:32 +10:00
Daniel Cousens
50e9a09a8c
Wallet: cleanup createTx control flow
...
Unknowingly this also revealed a subtle bug in the previous
implementation which allowed the creation of transactions even
when no UTXOs existed.
2014-05-30 18:17:18 +10:00