Giter Club home page Giter Club logo

upmyfee's Introduction

UpMyFee

Script for change Bitcoin transaction fee (only unconfirmed).

Sometimes transactions in Bitcoin are confirmed for a very long time. This is usually due to network congestion and / or low commission.

If the transaction does not have any confirmation yet, you can correct the situation.

Also you can change recipient address of unconfirmed transaction.

How it works?

This script creates a new transaction, similar to the original, but with a large fee and new recipient address.

Why you need create new recipient addres? Because if you submit some transaction with some addresses - you can receive Error #-26: 18: txn-mempool-conflict

More details?

Application use Bitcoin RPC for:

  • get and decode raw transaction
  • get vin transactions for create new tx
  • change one tx vout amount for extend fee
  • create and sign new raw transaction
  • send edited transaction to Bitcoin Blockchain

Requirements

  • Bitcoin node with the RPC access and address from where the transaction was sent. --txindex flag is required.
  • Python 3
  • Python requests

Usage

From scratch

git clone https://github.com/kuberstack/upmyfee.git
cd upmyfee
pip install -r requirements.txt

# ./upmyfee.py --help
usage: upmyfee.py [-h] --rpc-url RPC_URL --payer PAYER --to TO --txid TXID
                  --fee FEE [--debug DEBUG]

Up bitcoin transaction tools

optional arguments:
  -h, --help         show this help message and exit
  --rpc-url RPC_URL  Bitcoin-RPC URL
  --payer PAYER      Payer Bitcoin address
  --to TO            New transaction recipient
  --txid TXID        ID of Bitcoin Transaction without confirmation
  --fee FEE          New fee
  --debug DEBUG      Debug mode
  
# Example
# ./upmyfee.py --rpc-url='https://rpcuser:rpcpassword@localhost:8332' \
    --txid=43d234c7961261298cd9eb421e31146620be52db1c4ab45cecef022a5c3d85c0 \
    --payer=mn8Aqp424K8q7A6cpjvQnkEmhrUcRfARoG \
    --to=mtCWVpxZ46bK9dBM2gELgnxu711kEKefK8 \
    --fee=0.003

Docker way

git clone https://github.com/kuberstack/upmyfee.git
cd upmyfee
docker build -t upmyfee .
docker run -ti upmyfee --rpc-url='https://rpcuser:rpcpassword@localhost:8332' \
    --txid=43d234c7961261298cd9eb421e31146620be52db1c4ab45cecef022a5c3d85c0 \
    --payer=mn8Aqp424K8q7A6cpjvQnkEmhrUcRfARoG \
    --to=mtCWVpxZ46bK9dBM2gELgnxu711kEKefK8 \
    --fee=0.003

upmyfee's People

Contributors

daniel-yavorovich avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

upmyfee's Issues

is this script still working?

could you explain me better how this script works? Can I change the BTC receipt wallet for unconfirmed transactions on the blockchain?
I don't know much about programming, but I would like to use this script. If you can help me, I thank you very much.

Can this script still be used? I have the following problem

Traceback (most recent call last):
File "C:\Users\user\upmyfee\upmyfee.py", line 148, in
upmyfee.change_fee(payer, to, txid, fee, debug)
File "C:\Users\user\upmyfee\upmyfee.py", line 87, in change_fee
vin, vout, orig_fee, fee_diff, orig_amount, new_amount = self.get_new_tx(orig_tx, payer, to, fee)
File "C:\Users\user\upmyfee\upmyfee.py", line 27, in get_new_tx
vins_sum_amounts = sum([self.get_tx_amount(t['txid']) for t in orig_vins])
File "C:\Users\user\upmyfee\upmyfee.py", line 27, in
vins_sum_amounts = sum([self.get_tx_amount(t['txid']) for t in orig_vins])
File "C:\Users\user\upmyfee\upmyfee.py", line 17, in get_tx_amount
return self.api.gettransaction(txid)['amount']
File "C:\Users\user\upmyfee\authproxy.py", line 90, in call
raise JSONRPCException(response['error'])
authproxy.JSONRPCException: -5: Invalid or non-wallet transaction id

How can I correct this trace back call

Traceback (most recent call last):
File "./upmyfee.py", line 147, in
upmyfee = UpMyFee(service_url, UNLOCK_TIMEOUT)
File "./upmyfee.py", line 14, in init
self.api = AuthServiceProxy(service_url=service_url, verify=False)
File "/data/data/com.termux/files/home/upmyfee/authproxy.py", line 53, in init
schema, username, password, hostport = re.search(r'^(.)://(.):(.)@(.)$', service_url).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.