Commit graph

6 commits

Author SHA1 Message Date
Josh Rickmar e837ca5b64 Cleanly remove disconnected clients.
Also fixes a bug where responses for a single client would be sent to
every connected client.
2014-02-18 12:39:53 -05:00
Owain G. Ainsworth ed264697e7 Implement the listunspent command
closes #54
2014-02-14 14:35:58 +00:00
Josh Rickmar 114bb581f7 Fix hang related to account file writes.
The disk syncer now maintains its own countdown timer, creating a new
timer only when necessary (when there is no timer running, and
something is scheduled to be written).  When the timer expires, the
select loop begins selecting on a grab of the account manager's binary
semaphore, and if read, performs the sync and nils the select channel
to prevent a future grab until a new timer has expired.

Tested with a race-enabled build on Windows.  No lockups or races
related to the disk syncing experienced with constant client requests
and incoming btcd notifications, and scheduled writes run as expected
once the countdown timer expires, locking out all server request and
notifiation handling.
2014-02-05 12:47:33 -05:00
Owain G. Ainsworth b978c7e059 Impelment the gettransaction rpc command.
Closes #44.
2014-02-04 16:29:33 +00:00
Josh Rickmar 8dac5080ac Change AccountManager to not wait for disk flushes.
Should fix hang found by dhill.
2014-02-03 18:15:36 -05:00
Josh Rickmar 6a08c7de07 Redo account locking and RPC request processing.
This change removes the three separate mutexes which used to lock an
account's wallet, tx store, and utxo store.  Accounts no longer
contain any locking mechanism and rely on go's other synchronization
constructs (goroutines and channels) for correct access.

All accounts are now managed as a collection through the new
AccountManager, rather than the old AccountStore.  AccountManager runs
as its own goroutine to provide access to accounts.

RPC requests are now queued for handling, being denied if the queue
buffer is exhausted.  Notifications are also queued (instead of being
sent from their own goroutine after being received, in which order is
undefined), however, notifications are never dropped and will
potentially grow a queue of infinite size if unhandled.
2014-02-01 13:18:34 -05:00