* Fix off by small amounts in sent amount kaspa
Floating point math causes inconsistencies when converting kas to sompi.
Use a method that parses the amount as a string, the converts it to
sompi then parse back to uint64
* Deal with SendAmount as strings all the way
* Consistent config handling
* Set variables directly from utils.KasToSompi
Use = instead of := to ensure no shadowing
* Fix validate amount regex
* Use decimal places as defined by constants
Also check if SompiPerKaspa is multiple of 10
* Minor updates for context clarity
* Use one of the From addresses as a change address
* Use change address from fromAddress only if useExisting is set to true
* Change FromAddresses description
* RPC: include orphans into mempool entries
* no need for + 1
* give request option to choose mempool pool(s)
* add to wallet, fix bg
* use orphanpool rpc to test for orphans
* fix fmt
* fix crash when quering orphan pool in get_mempool_entries
* pass the tests, fix fromAppMessage bug
* Update config_test.go
don't think this is needed
* needed for tests to pass
* inverse to transactionpoolfilter, cut down code to two ifs.
* fmt
* update test to true false, forgot one includetransactionpool renaming
* update and simplyfiy get_mempool_entry handler
* comment outdated
* i think we usually use make instead of var.
* Fix some leftovers of includeTransactionPool
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* start
* pass tests, (cannot get before put!) and clean up.
* add rpc call.
* create and pass tests, fix bugs. fully implement rpc
* As always fmt
* remover old test
* clean up proto comment
* put the logger back in place.
* revert back to 10 sec limit.
* migration, change utxoChanged removal to whole utxoEntryPair, add methods to update circulating supply, intialize circulating supply from reset.
* Update utxoindex.go
* ad
* rename to max, change comment
* one more total to max
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Fix wallet parsing of multi tx data
* Output wallet msgs to stderr when creating/signing tx
* Fix go fmt
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* add wallet daemon state messages to a terminal window log
* refactoring changed var name to harmonize it
* fix global vars made the part of the "sever" class
* fix log message phrasing
Co-authored-by: Michael Sutton <mikisiton2@gmail.com>
* Wallet synchronization improvement
* Much faster sync on startup
* Avoid double scan of the same address range
* Eliminate 1 sec delay on start
* Rename constant and add numIndexesToQueryForRecentAddresses const
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Added option to choose from address in kaspawallet + fixed a bug with 0 change
* Checking if From is missing
* Fixed after merge to kaspad0.12
* Applying changes also to send command
* Better help description
* Fixed bug where we take all utxos except the one we wanted
* Swallow the parsing error only when we want to filter
* checking for wallet address directly
* go fmt
* Changing to `--from-address`
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Add "sweep" command to kaspawallet
* minor linting & layout improvements.
* contain code in "sweep"
* update to sweep.go
* formatting and bugs
* clean up renaming of ExtractTransaction functions
* Nicer formating of display
* address reveiw.
* one more sweeped -> swept
* missed one reveiw comment. (extra mass).
* remove redundant code from split function.
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Use separate than finality depth for merge set calculations after HF
* Add comments and edit error messages
* Fix TestValidateTransactionInContextAndPopulateFee
* Don't disconnect from node if isViolatingBoundedMergeDepth
* Use new merge root for virtual pick parents; apply HF1 daa score split for validation only
* Use `blue work` heuristic to skip irrelevant relay blocks
* Minor
* Make sure virtual's merge depth root is a real block
* For ghostdag data we always use the non-trusted data
* Fix TestBoundedMergeDepth and in IBD use VirtualMergeDepthRoot instead of MergeDepthRoot
* Update HF1DAAScore
* Make sure merge root and finality are called + avoid calculating virtual root twice
* Update block version to 1 after HF
* Update to v0.12.0
Co-authored-by: msutton <mikisiton2@gmail.com>
* Add send and sign commands to protobuf
* Added Send and Sign stubs in kaspawalletd server
* Implement Sign
* Implemented Send
* Allow Broadcast command to supply multiple transactions
* No longer prompt for password in DecryptMnemonics
* Rename TransactionIDs -> TxIDs to keep consistency with Broadcast
* Add some comments and formatting
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* protobuf for new block template notification structs
* appmessage and wire for new block template notification structs
* Set up the entire handler/call-chain for managing the new-block-template event
* Add GetUTXOsByBalances command to rpc
* Fix wrong commands in GetBalanceByAddress
* Moved calculation of TransactionMass out of TransactionValidator, so t that it can be used in kaspawallet
* Allow CreateUnsignedTransaction to return multiple transactions
* Start working on split
* Implement maybeSplitTransactionInner
* estimateMassIncreaseForSignatures should multiply by the number of inputs
* Implement createSplitTransaction
* Implement mergeTransactions
* Broadcast all transaction, not only 1
* workaround missing UTXOEntry in partially signed transaction
* Bugfix in broadcast loop
* Add underscores in some constants
* Make all nets RelayNonStdTxs: false
* Change estimateMassIncreaseForSignatures to estimateMassAfterSignatures
* Allow situations where merge transaction doesn't have enough funds to pay fees
* Add comments
* A few of renames
* Handle missed errors
* Fix clone of PubKeySignaturePair to properly clone nil signatures
* Add sanity check to make sure originalTransaction has exactly two outputs
* Re-use change address for splitAddress
* Add one more utxo if the total amount is smaller then what we need to send due to fees
* Fix off-by-1 error in splitTrasnaction
* Add a comment to maybeAutoCompoundTransaction
* Add comment on why we are increasing inputCountPerSplit
* Add comment explaining while originalTransaction has 1 or 2 outputs
* Move oneMoreUTXOForMergeTransaction to split_transaction.go
* Allow to add multiple utxos to pay fee for mergeTransactions, if needed
* calculate split input counts and sizes properly
* Allow multiple transactions inside the create-unsigned-transaction -> sign -> broadcast workflow
* Print the number of transaction which was sent, in case there were multiple
* Rename broadcastConfig.Transaction(File) to Transactions(File)
* Convert alreadySelectedUTXOs to a map
* Fix a typo
* Add comment explaining that we assume all inputs are the same
* Revert over-refactor of rename of config.Transaction -> config.Transactions
* Rename: inputPerSplitCount -> inputsPerSplitCount
* Add comment for splitAndInputPerSplitCounts
* Use createSplitTransaction to calculate the upper bound of mass for split transactions
* Add boilerplate for the `parse` sub command.
* Deserialize the given transaction hax.
* Implement the rest of the wallet parse command.
* Hide transaction inputs behind a `verbose` flag.
* Indicate that we aren't able to extract an address out of a nonstandard transaction.
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* Make kaspawallet store the utxos sorted by amount, so that the bigger utxos are spent first - making it less likely a compound will be required
* Start refactor addEntryToUTXOSet
* Add GetUTXOsByBalances command to rpc
* Store list of addresses, updated with the collectAddresses methods
(replacing collectUTXOs methods)
* Fix wrong commands in GetBalanceByAddress
* Rename: refreshExistingUTXOs -> refreshUTXOs
Co-authored-by: Ori Newman <orinewman1@gmail.com>